CVE-2020-1747:
Improper Input Validation in PyYAML
9.8
CVSS ScoreBasic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
4/20/2021
Updated
10/31/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pyyaml | pip | >= 5.1b7, < 5.3.1 | 5.3.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from insufficient validation when setting object state during deserialization. The commit diff shows critical additions:- 1) check_state_key() to block forbidden keys- 2) Modified set_python_instance_state() to enforce the blacklist. The unpatched FullLoader's set_python_instance_state allowed attackers to set arbitrary attributes (like reduce) via crafted YAML, leading to code execution. The construct_python_object_apply method triggered this unsafe state-setting process. These functions were directly modified in the security patch to add validation.