Skip to content

Commit 37a7ac6

Browse files
authored
Merge pull request #62 from jriddy/revert-pyyaml-version
revert pyyaml requirement version
2 parents 7e24392 + dcd0c2a commit 37a7ac6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ from openapi_spec_validator import openapi_v3_spec_validator
6969
errors_iterator = openapi_v3_spec_validator.iter_errors(spec)
7070
```
7171

72+
## Security Note
73+
74+
PyYAML, a requirement of this project, has a
75+
[security vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2017-18342)
76+
in the default implementation of `yaml.load()`, which allows execution
77+
of arbitrary code while loading a target file or stream. OpenAPI Spec
78+
Validator uses a safe loader to ensure that only Python objects
79+
marked as safe can be executed. Thus, you are not exposed to this
80+
vulnerability by using this package.
81+
82+
If you use `PyYAML` directly, be sure to use `yaml.safe_load()` to
83+
avoid inadvertantly exposing youself to potentially malicous data. The
84+
[PyYAML docs](https://pyyaml.org/wiki/PyYAMLDocumentation#loading-yaml)
85+
describe this issue in detail.
86+
7287
## Related projects
7388

7489
* [openapi-core](https://github.com/p1c2u/openapi-core) is a Python library that adds client-side and server-side support for the OpenAPI.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def run_tests(self):
6969
},
7070
install_requires=[
7171
"jsonschema<3",
72-
"PyYAML>=4.2b1",
72+
"PyYAML>=3.13",
7373
"six",
7474
'pathlib;python_version=="2.7"',
7575
],

0 commit comments

Comments
 (0)