CVE-2017-18342
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.
What to do
Fixed builds are available from Debian, PyPI: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 20.04 | pyyaml | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | pyyaml | Will not fix The patch changes the incredibly-unsafe yaml.load to the behaviour of safe_load; despite being many years overdue, it's also likely to break something.… | UBUNTU-CVE-2017-18342 | |
| Ubuntu 16.04 | pyyaml | Will not fix The patch changes the incredibly-unsafe yaml.load to the behaviour of safe_load; despite being many years overdue, it's also likely to break something.… | UBUNTU-CVE-2017-18342 | |
| Ubuntu 14.04 | pyyaml | Will not fix The patch changes the incredibly-unsafe yaml.load to the behaviour of safe_load; despite being many years overdue, it's also likely to break something.… | UBUNTU-CVE-2017-18342 | |
| Debian 14 | pyyaml | Fixed | 5.1.2-1 | DEBIAN-CVE-2017-18342 |
| Debian 13 | pyyaml | Fixed | 5.1.2-1 | DEBIAN-CVE-2017-18342 |
| Debian 12 | pyyaml | Fixed | 5.1.2-1 | DEBIAN-CVE-2017-18342 |
| Red Hat Enterprise Linux 8 | PyYAML | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | python2-pyyaml | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | python38-pyyaml | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | python39-pyyaml | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 7 | PyYAML | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 6 | PyYAML | Will not fix Will not fix | ||
| PyPI library | pyyaml | Fixed | 5.1 | GHSA-rprw-h62v-c2w7 |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://security.gentoo.org/glsa/202003-45 (vendor-advisory)
References
- https://github.com/yaml/pyyaml/pull/74
- https://github.com/yaml/pyyaml/blob/master/CHANGES
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M6JCFGEIEOFMWWIXGHSELMKQDD4CV2BA/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KSQQMRUQSXBSUXLCRD3TSZYQ7SEZRKCE/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JEX7IPV5P2QJITAMA5Z63GQCZA5I6NVZ/
- https://github.com/marshmallow-code/apispec/issues/278
- https://github.com/yaml/pyyaml/issues/193
- https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load%28input%29-Deprecation
- https://security.gentoo.org/glsa/202003-45
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.