Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the interface path to prevent security issues. #7

Merged
merged 3 commits into from
Dec 5, 2019

Conversation

evshary
Copy link
Contributor

@evshary evshary commented Nov 17, 2019

I found that there might be a security issue when trying to use ros interface. I can get the content of any files by adding ... For example:

ros2 interface show std_msgs/../../../../install/local_setup.bash

I think this is not what we want, so I add some limitations into get_interface_path, including no .. in path and the namespace should be msg, srv or action.
I'm not sure whether the namespace should always be one of msg, srv or action. Please tell me if I'm wrong.

Signed-off-by: evshary <evshary@gmail.com>
Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this a security issue? You can also get the content of any arbitrary file using cat <random-path>.

rosidl_runtime_py/get_interfaces.py Outdated Show resolved Hide resolved
future.

Signed-off-by: evshary <evshary@gmail.com>
Signed-off-by: evshary <evshary@gmail.com>
@dirk-thomas dirk-thomas removed their assignment Dec 5, 2019
Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution and for iterating on this.

@dirk-thomas dirk-thomas merged commit 61a67b4 into ros2:master Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants