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

Potential vulnerability with yaml.loader #580

Closed
FabioRosado opened this issue Jul 18, 2018 · 4 comments · Fixed by #589
Closed

Potential vulnerability with yaml.loader #580

FabioRosado opened this issue Jul 18, 2018 · 4 comments · Fixed by #589

Comments

@FabioRosado
Copy link
Member

FabioRosado commented Jul 18, 2018

Description

I was listening to Talk Python to Me podcast - the one where they talk about Python vulnerabilities and things that we shouldn't be doing in Python. One of the things that they mention was using yaml.load instead of yaml.safe_load.

I know that when I wrote the bit of code so we can use !include I use yaml.loader so perhaps this should be changed to yaml.safe_load. One thing I didn't understand was if the yaml.loader is now set as the default safe_load or not. (Mostly due to this issue).

I tried to swap yaml.load for yaml.safe_load but tox complained and both the environmental variables and the !include tests are failing.

Should I dig deeper and try to make the safe_load work?

Also, this article in hackernoon might be interesting for reference about this issue - 10 common security gotchas in Python and how to avoid them

@jacobtomlinson
Copy link
Member

Funnily enough I was looking into this yesterday!

The recent PRs have been failed due to there being an open CVE for pyyaml. From looking into it I think this vulnerability has been ackowledged for a while but when using the latest version of pyyaml with python 3.7 you may experience the vulnerability.

They are planning on releasing a new version of pyyaml which addresses this vulnerability. As this issue will affect all existing versions of opsdroid I think we are ok to go ahead and merge PRs which have failed due to this.

I totally agree that we should explore yaml.safe_load. If you have the time to dig deeper that would be great!

@FabioRosado
Copy link
Member Author

Yeah, I was a bit confused due to that PR that said it implements safe_load as default although the documentation still tells you to not use load and use safe_load instead. For some reason, the tests are failing I will look into it further and try to figure out why they are failing 👍

@jacobtomlinson
Copy link
Member

Getting #574 merged is the priority at the moment. If you could look into it that would be great.

@FabioRosado
Copy link
Member Author

Closed as it got solved in 803

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants