For security reasons detailed below, we strongly suggest avoiding the usage of strings from parameters as topic name.
Although parameters are usually set in parameter files, they can also be changed by nodes. Specifically, other nodes in the same ROS application can also change the parameters listed above before it’s used, either by accident or intentionally (i.e., by potential attackers). If the ~/time_ref_topic parameter is changed, the shm_driver node will subscribe to a wrong topic, which can interrupt the sending of TimeReference message. If an attacker exists, she can control the time by first fooling the shm_driver node to subscribe to a wrong topic like ~/time_ref_fake, and then forwarding messages from topic ~/time_ref to ~/time_ref_fake after changing the contents. The robot’s behavior may be changed in various ways based on what the downstream applications are that read from the ntpd. Because ROS is an OSS (open-source software) community, third-party nodes are widely used in ROS applications, usually without complete vetting of their behavior, which gives the opportunity to potentially malicious actors to inject malicious code (e.g, by submitting hypocrite commits like in other OSS systems [1]) to infiltrate the ROS applications that use it (or software supply chain attacks, one of the primary means for real-world attackers today [2]).
We understand that using parameters to set topic names brings flexibility. Still, for the purpose of security, we strongly suggest that you avoid such vulnerable programming patterns if possible. For example, to avoid the exposure of this specific vulnerability, you may consider alternatives like remapping, which is designed for configuring names when launching the nodes.
Thank you for your review! Actually i don't remember why i merged param option, while initially suggested to use remapping...
If i had have some time this vacation dates i would try to release versions without topic param.
Hi,
We notice that you are using topic name from ROS parameter at the following locations:
ntpd_driver/src/shm_driver.cpp
Line 230 in b8b9e1d
For security reasons detailed below, we strongly suggest avoiding the usage of strings from parameters as topic name.
Although parameters are usually set in parameter files, they can also be changed by nodes. Specifically, other nodes in the same ROS application can also change the parameters listed above before it’s used, either by accident or intentionally (i.e., by potential attackers). If the
~/time_ref_topicparameter is changed, the shm_driver node will subscribe to a wrong topic, which can interrupt the sending of TimeReference message. If an attacker exists, she can control the time by first fooling the shm_driver node to subscribe to a wrong topic like~/time_ref_fake, and then forwarding messages from topic~/time_refto~/time_ref_fakeafter changing the contents. The robot’s behavior may be changed in various ways based on what the downstream applications are that read from the ntpd. Because ROS is an OSS (open-source software) community, third-party nodes are widely used in ROS applications, usually without complete vetting of their behavior, which gives the opportunity to potentially malicious actors to inject malicious code (e.g, by submitting hypocrite commits like in other OSS systems [1]) to infiltrate the ROS applications that use it (or software supply chain attacks, one of the primary means for real-world attackers today [2]).We understand that using parameters to set topic names brings flexibility. Still, for the purpose of security, we strongly suggest that you avoid such vulnerable programming patterns if possible. For example, to avoid the exposure of this specific vulnerability, you may consider alternatives like remapping, which is designed for configuring names when launching the nodes.
[1] Q. Wu and K. Lu, “On the feasibility of stealthily introducing vulnerabilities in open-source software via hypocrite commits,” 2021, https://linuxreviews.org/images/d/d9/OpenSourceInsecurity.pdf.
[2] Supply chain attacks are the hacker’s new favourite weapon. and the threat is getting bigger. https://www.zdnet.com/article/supply-chain-attacks-are-the-hackers-new-favourite-weapon-and-the-threat-is-getting-bigger/.
The text was updated successfully, but these errors were encountered: