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

[kinetic] Switch to yaml.safe_load #1842

Closed
wants to merge 1 commit into from

Conversation

130s
Copy link
Member

@130s 130s commented Nov 28, 2019

Problem

File parsing with unsafe methods can be a threat.

yaml.load is recommended to be avoided in e.g. security.openstack.org.

Potential solution

For the particular method in question (yaml.load), there's also a recommended method in the same link. So use that.

In fact in melodic-devel this is already done #1688. This PR is essentially a cherry-pick of that.

* Switch to yaml.safe_load(_all) to prevent YAMLLoadWarning

* Change all usages of yaml.load to yaml.safe_load

* Extend PyYAML's SafeLoader and use it with `yaml.load`

Also added convenience functions for using this loader for reuse in
`roslaunch`

* fix typo in rosparam.yaml_load_all

* Modify Loader and SafeLoader in yaml module directly

* Revert whitespace change

* Revert unrelated change to import through global variable construction
@dirk-thomas dirk-thomas changed the title [kinetic] Switch to yaml.safe_load (cherrypicking #1688) [kinetic] Switch to yaml.safe_load Feb 10, 2020
@dirk-thomas
Copy link
Member

The original fix hasn't been released into Melodic yet (which will happen soon). After that all changes from the melodic-devel branch will be considered for backporting to kinetic-devel. Therefore closing this as a duplicate.

@130s 130s deleted the ISY/yaml_safe_load/kd branch February 11, 2020 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants