CriticalGHSA-rprw-h62v-c2w7CVE-2017-18342PYSEC-2018-49

PyYAML insecurely deserializes YAML strings leading to arbitrary code execution

Published 4 Jan 2019 · Updated 1 Jul 2026

Is your project on an affected pyyaml?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

pyyamlPyPI
Affected
<5.1
Fixed in
5.1
Update to the fixed version for your release line, for example:pip install 'pyyaml>=5.1'

Details

In PyYAML before 5.1, the yaml.load() API could execute arbitrary code. In other words, yaml.safe_load is not used.

This was intended to be fixed in 4.1, but due to breaking changes, 4.1 was yanked and 5.1 contains the patch for CVE-2017-18342.

Is GHSA-rprw-h62v-c2w7 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected pyyaml, and gives you the command that fixes it.

More advisories for pyyaml

  • CriticalCVE-2019-20477Deserialization of Untrusted Data in PyYAML · 20 Apr 2021
  • CriticalCVE-2020-1747Improper Input Validation in PyYAML · 20 Apr 2021
  • CriticalCVE-2020-14343Improper Input Validation in PyYAML · 25 Mar 2021
pyyaml security overview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.