Skip to content

Commit 1c413fb

Browse files
alexoliverchang
authored andcommitted
Avoid yaml.load, and prefer yaml.safe_load (#95)
yaml.load ought to be named yaml.danger_load: it can execute arbitrary code (http://pyyaml.org/wiki/PyYAMLDocumentation#LoadingYAML)
1 parent ebffa79 commit 1c413fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

infra/auto-setup/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def sync_jenkins_job(server, library):
6363
"""Sync the config with jenkins."""
6464
target_yaml = os.path.join(OSSFUZZ_DIR, 'targets', library, 'target.yaml')
6565
with open(target_yaml, 'r') as f:
66-
target_json_string = json.dumps(json.dumps(yaml.load(f)))
66+
target_json_string = json.dumps(json.dumps(yaml.safe_load(f)))
6767

6868
job_name = 'targets/' + library
6969
job_definition = ET.parse(os.path.join(SCRIPT_DIR, 'jenkins_config',

0 commit comments

Comments
 (0)