Skip to content

Commit 3aa4727

Browse files
committed
Use yaml.safe_load rather than yaml.load for security.
1 parent 6678613 commit 3aa4727

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lambda_tools/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def upgrade(data):
329329

330330
def load(filename):
331331
with open(filename) as f:
332-
raw_data = yaml.load(f)
332+
raw_data = yaml.safe_load(f)
333333
data = upgrade(raw_data)
334334
config = mapper.parse(Configuration, data)
335335
config.root = os.path.dirname(filename)

tests/test_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def load_yaml(filename):
1212
testfile = os.path.join(os.path.dirname(__file__), filename)
1313
with open(testfile) as f:
14-
return yaml.load(f)
14+
return yaml.safe_load(f)
1515

1616
class TestSchema(unittest.TestCase):
1717

0 commit comments

Comments
 (0)