cve.bz

CVE-2017-18342 Deserialization of Untrusted Data

9.8 criticalEPSS 5.6%Fix available

Critical (9.8). EPSS 5.6% estimated probability of exploitation activity in the next 30 days. Fixed in pyyaml 5.1.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
5.6% (unchanged from 5.6% a week ago; 5.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 93rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-502 Deserialization of Untrusted Data
OWASP Top 10
A08:2025 Software or Data Integrity Failures
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2017-18342 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2017-18342?via=ask-ai-copy and https://cve.bz/cve/CVE-2017-18342?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2017-18342 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
pyyaml:pyyamlbefore 5.1
fedoraproject:fedora28
fedoraproject:fedora29
fedoraproject:fedora30

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-rprw-h62v-c2w7PyPIpyyaml<5.15.1
PYSEC-2018-49PyPIpyyaml<5.15.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14pyyaml5.1.2-1DEBIAN-CVE-2017-18342
Ubuntu14.04:LTS, 16.04:LTS, 18.04:LTSpyyamlno fix listedUBUNTU-CVE-2017-18342
openSUSETumbleweedoci-cli3.0.2-1.2openSUSE-SU-2024:11108-1
openSUSETumbleweedpython-PyYAML5.4.1-1.6openSUSE-SU-2024:11210-1
openSUSETumbleweedpython-PyYAML6.0.1-4.1openSUSE-SU-2024:14089-1
openSUSETumbleweedpython-PyYAML6.0.3-1.6openSUSE-SU-2026:11996-1
openSUSETumbleweedpython-openapi-spec-validator0.7.1-1.3openSUSE-SU-2024:14152-1
openSUSETumbleweedpython-openapi-spec-validator0.9.0-1.1openSUSE-SU-2026:11192-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

The default loading mechanism in PyYAML contains fundamental and long-standing functionality that allows for arbitrary code execution.

The yaml.load() function (when called without a specified loader), has been documented as inherently unsafe since its first release. When processing YAML input, this function can call any Python function, including those that execute system commands (i.e., os.system()).

In response, the PyYAML maintainers have deprecated the plain use of yaml.load() to encourage developers to explicitly choose a safer option. The yaml.safe_load() function is the intended replacement. It handles a safe subset of the YAML language and disables the dangerous features that permit arbitrary code execution, effectively neutralizing the RCE threat from untrusted input.

However, to maintain backwards compatibility the yaml.load() function remains available. Its default behavior (as of PyYAML 5.1) was to use FullLoader and issue a warning. FullLoader was deemed not safe for untrusted data, and as of PyYAML 6.0 yaml.load() requires an explicit Loader argument. The original vulnerable loader is also retained (again, in the interest of backwards compatibility) which provides the attack vector.

The code executed via PyYAML runs as the user invoking the python binary calling the pyyaml module– there is no inherent privilege escalation. Therefore any exploit affecting any substantial impact requires privilege escalation via a separate vulnerability or poor application design and/or poor coding practices.

Given that the vulnerability in PyYAML’s load function provides a mechanism for threat actors to potentially impact a system via a wide range of Python functions, Red Hat must err on the side of caution and view the possible impact to Confidentiality, Integrity, and Availability as High.

Red Hat's mitigation

Any codebases written in Python and employing the PyYAML library should be audited. Developers should replace every instance of the deprecated yaml.load() function with the secure alternative, yaml.safe_load(), especially when handling configuration or data from untrusted sources. Any applications invoking python where PyYAML is available should run as a non-privileged user.

ProductPackageStateAdvisory
Red Hat Ceph Storage 1.3PyYAMLWill not fix
Red Hat Enterprise Linux 6PyYAMLWill not fix
Red Hat Enterprise Linux 7PyYAMLWill not fix
Red Hat Enterprise Linux 8PyYAMLWill not fix
Red Hat Enterprise Linux OpenStack Platform 7 (Kilo)PyYAMLWill not fix
Red Hat Enterprise MRG 2PyYAMLWill not fix
Red Hat OpenStack Platform 10 (Newton)PyYAMLWill not fix
Red Hat OpenStack Platform 12 (Pike)PyYAMLWill not fix
Red Hat OpenStack Platform 13 (Queens)PyYAMLWill not fix
Red Hat OpenStack Platform 15 (Stein)PyYAMLNot affected
Red Hat OpenStack Platform 8 (Liberty)PyYAMLWill not fix
Red Hat OpenStack Platform 9 (Mitaka)PyYAMLWill not fix
Red Hat Satellite 5PyYAMLWill not fix
Red Hat Software Collectionspython27-PyYAMLWill not fix
Red Hat Software Collectionsrh-python36-PyYAMLWill not fix

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2017-18342.

Attack patterns (CAPEC)

  • CAPEC-586 Object Injection Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON