Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Potential vulnerability: topic names from ROS parameters #18

@tandf

Description

@tandf

Hi,

We notice that you are using topic names from ROS parameters at the following locations:

self._results_pub = rospy.Publisher(results_topic, DialogflowResult,

rospy.Subscriber(text_req_topic, String, self._text_request_cb)

rospy.Subscriber(text_event_topic, String, self._text_event_cb)

rospy.Subscriber(msg_req_topic, DialogflowRequest, self._msg_request_cb)

rospy.Subscriber(event_req_topic, DialogflowEvent, self._event_request_cb)

self.text_pub = rospy.Publisher(text_topic, String, queue_size=10)

For security reasons detailed below, we strongly suggest avoiding the usage of strings from parameters as topic names.

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). For example, if the /dialogflow_client/results_topic parameter is changed, the dialogflow_client node may publish the results to a wrong topic, and the user nodes of the dialogflow service cannot receive the results. Moreover, if an attacker exists, she can even manipulate the results by first fooling the dialogflow_client node to publish to a wrong topic like /dialogflow_client/results_fake, and the forward the messages from /dialogflow_client/results_fake to /dialogflow_client/results after changing the contents as she wants. 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/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions