Skip to content

Commit 8ff5777

Browse files
authored
Replace yaml.load with yaml.safe_load for Enhanced Security (#150)
This pull request addresses a security vulnerability in our codebase by replacing the potentially unsafe yaml.load function with the safer yaml.safe_load. The yaml.load function, when used with untrusted input, can execute arbitrary code, leading to potential security risks. By switching to yaml.safe_load, we ensure that only a subset of the YAML language is parsed, effectively mitigating these risks. Changes Made: Replaced all instances of yaml.load with yaml.safe_load in the script. Updated the relevant test cases to align with the safe_load usage. Benefits: Improves security by preventing arbitrary code execution. Maintains functionality while reducing risk from untrusted YAML inputs.
1 parent 829cf97 commit 8ff5777

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/utils/script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def append_doc_to_spec_file(index: dict):
186186

187187
# Get skeleton spec
188188
spec_path = PROJECT_PATH + '/docs/utils/skeleton-spec.yaml'
189-
spec = yaml.load(open(spec_path, 'r'), Loader=yaml.FullLoader)
189+
spec = yaml.safe_load(open(spec_path, 'r'))
190190

191191
# Update version
192192
from pinterest.version import __version__

0 commit comments

Comments
 (0)