CVE-2017-18342
PyYAML insecurely deserializes YAML strings leading to arbitrary code execution
Reported by mitre · Published June 27, 2018
PyYAML is fixed in 5.1.0, 5.1 and 4.1 (PyPI)
In PyYAML before 5.1, the yaml.load() API could execute arbitrary code if used with untrusted data. The load() function has been deprecated in version 5.1 and the 'UnsafeLoader' has been introduced for backward compatibility with the function.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| PyYAML | PyPI | 5.1.0, 5.1, 4.1 |
| pyyaml | pyyaml | 5.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| PyPI | PyYAML | 0 |
| n/a | n/a | * |
| arch | python-yaml | 0 |
Timeline
- Jun 27, 2018 CVE Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Nov 21, 2024 CVE Updated
- May 14, 2025 PoC Published (2 in total, the first dated here)
- Mar 9, 2026 Security Advisory (2 in total, the first dated here)
- Oct 1, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2017-18342
vulnetix vdb fixes CVE-2017-18342
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2017-18342/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_MISC
- FEDORA-2019-bed9afe622 vendor-advisoryx_refsource_FEDORA
- FEDORA-2019-779a9db46a vendor-advisoryx_refsource_FEDORA
- FEDORA-2019-44643e8bcb vendor-advisoryx_refsource_FEDORA
- x_refsource_MISC
- x_refsource_MISC
- x_refsource_MISC
- GLSA-202003-45 vendor-advisoryx_refsource_GENTOO
- https://nvd.nist.gov/vuln/detail/CVE-2017-18342 advisory
- https://github.com/advisories/GHSA-rprw-h62v-c2w7 advisory
- https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation url
- https://github.com/yaml/pyyaml/commit/7b68405c81db889f83c32846462b238ccae5be80 patch
- https://github.com/pypa/advisory-database/tree/main/vulns/pyyaml/PYSEC-2018-49.yaml advisory
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JEX7IPV5P2QJITAMA5Z63GQCZA5I6NVZ url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSQQMRUQSXBSUXLCRD3TSZYQ7SEZRKCE url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/M6JCFGEIEOFMWWIXGHSELMKQDD4CV2BA url
- https://github.com/yaml/pyyaml/issues/207#issuecomment-472520007 url