CriticalGHSA-8q59-q68h-6hv4CVE-2020-14343PYSEC-2021-142

Improper Input Validation in PyYAML

Published 25 Mar 2021 · Updated 4 Feb 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.4
Fixed in
5.4
Update to the fixed version for your release line, for example:pip install 'pyyaml>=5.4'

Details

A vulnerability was discovered in the PyYAML library in versions before 5.4, where it is susceptible to arbitrary code execution when it processes untrusted YAML files through the full_load method or with the FullLoader loader. Applications that use the library to process untrusted input may be vulnerable to this flaw. This flaw allows an attacker to execute arbitrary code on the system by abusing the python/object/new constructor. This flaw is due to an incomplete fix for CVE-2020-1747.

Is GHSA-8q59-q68h-6hv4 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-2017-18342PyYAML insecurely deserializes YAML strings leading to arbitrary code execution · 4 Jan 2019
pyyaml security overview

References

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