bandit/examples/yaml_load.py
Lucas Fisher 5d3a82d764 Add yaml.load to blacklist with yaml example file
yaml.load() allows creation of arbitrary Python objects and is unsafe
with untrusted input. Alert and suggest yaml.safe_load() instead.
Added example file for yaml.load and unit test.

Change-Id: Ie4b109462b4af6bb2c990e4d33d6fabf995134ca
2015-01-16 11:02:03 -08:00

8 lines
127 B
Python

import yaml
def test_yaml_load():
ystr = yaml.dump({'a' : 1, 'b' : 2, 'c' : 3})
y = yaml.load(ystr)
yaml.dump(y)