#35 Please use yaml.safe_load_all rather than load_all
Closed: Fixed Opened by puiterwijk.

yaml.load_all is very dangerous, as it states prominently on the PyYAML website:

Warning: 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. Check the yaml.safe_load function though.

Looking at it, there is literally no reason you can't use safe_load_all, so please use that.


Okay we can do that for safety. But note that it was never intended to accept YAML from untrusted sources, only to load the configured YAML policies which are under the control of the admin.

Once we eventually reach the point of allowing arbitrary user-submitted policies, we would be storing those in a db with an API (using JSON I guess) for updating the policies.

Well, I don't feel like doing a security audit for every "config" change that anyone proposes, just because it could theoretically run random code. So I would really appreciate it if you would use the safe_load versions. Thanks.

Metadata Update from @mjia:
- Issue status updated to: Closed (was: Open)

Metadata Update from @dcallagh:
- Issue assigned to mjia
- Issue close_status updated to: Fixed
- Issue set to the milestone: 0.1

Metadata