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

Swap out yaml.load() for yaml.safe_load() #102

Closed
blockauditech opened this issue Apr 28, 2018 · 5 comments
Closed

Swap out yaml.load() for yaml.safe_load() #102

blockauditech opened this issue Apr 28, 2018 · 5 comments

Comments

@blockauditech
Copy link

In main_controller.py, there's quite a few calls to yaml.load() which if they currently (or in the future) are passed data from outside the application or in other scenarios, such as over the web for various interactions, there's deserialization issues that could lead to arbitrary code execution.

"It is not safe to call yaml.load with any data received from an untrusted source! yaml.load is as powerful as pickle.load and so may call any Python function."

So if you're able to swap those out for yaml.safe_load() or just use JSON instead, that'd mitigate those risks here. We didn't test writing full exploit, but it's easy enough to harden things.

A couple references:
https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html
https://code.tutsplus.com/tutorials/serialization-and-deserialization-of-python-objects-part-2--cms-26184

@mikakoi
Copy link
Collaborator

mikakoi commented May 2, 2018

Thanks for the report, this was actually fixed in an older branch which was left hanging.

@blockauditech
Copy link
Author

Ah, that makes sense-- looking forward to the commits that harden things here.

We appreciate your time!

@MarkoPaasila
Copy link
Collaborator

@mikakoi can this be closed?

@mikakoi
Copy link
Collaborator

mikakoi commented May 30, 2018

No, it's not fixed yet. The fix is coming in the easyconfig pull request.

@mikakoi
Copy link
Collaborator

mikakoi commented Jun 7, 2018

Fixed in 0.4.0

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

No branches or pull requests

3 participants