aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorlhinds <lhinds@redhat.com>2017-07-08 16:51:27 +0100
committerJustin chi <chigang@huawei.com>2017-07-11 01:10:08 +0000
commit1833897d18fe0930984215372e1343cff1531b61 (patch)
tree4a90c727423647490da1c09bc357009871254dce /util
parent264ec7332c84617e95f2b7336dcee1a413bc7e6b (diff)
Utilize yaml.safe_load
The patch changes instances of yaml.load with yaml.safe_load which is more secure at blocking arbitrary code execution. The following blog has a decent explaination: https://www.kevinlondon.com/2015/08/15/dangerous-python-functions-pt2.html Change-Id: I8201baab6cb31ab31228eca83134f87a57c2f5d2 Signed-off-by: lhinds <lhinds@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/check_valid.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/check_valid.py b/util/check_valid.py
index e3ad6bcd..e6a72e71 100644
--- a/util/check_valid.py
+++ b/util/check_valid.py
@@ -17,7 +17,7 @@ import traceback
def load_file(file):
with open(file) as fd:
try:
- return yaml.load(fd)
+ return yaml.safe_load(fd)
except:
traceback.print_exc()
return None