CVE-2020-1747: Input Validation
A vulnerability was discovered in the PyYAML library in versions before 5.3.1, where it is susceptible to arbitrary code execution when it processes untrusted YAML files through the fullload method or with the FullLoader loader. Applications that use the library to process untrusted input may be vulnerable to this flaw. An attacker could use this flaw to execute arbitrary code on the system by abusing the python/object/new constructor.
Other sources
A vulnerability was discovered in the PyYAML library, where it is susceptible to arbitrary code execution when it processes untrusted YAML files through the fullload method or with the FullLoader loader. Applications that use the library to process untrusted input may be vulnerable to this flaw. An attacker could use this flaw to execute arbitrary code on the system by abusing the python/object/new constructor.
An arbitrary code execution was discovered in PyYAML when YAML files are parsed by FullLoader. This loader is used by default by yaml.load() when no loader is specified or when yaml.fullload() is used. Applications that use PyYAML to parse untrusted input may be vulnerable to this flaw, which would allow an attacker to execute arbitrary code on the system, by abusing the python/object/new constructor.
— Red Hat
PyYAML could allow a remote attacker to execute arbitrary code on the system, caused by an error when processing untrusted YAML files through the fullload method or with the FullLoader loader. By abusing the python/object/new constructor, an attacker could exploit this vulnerability to execute arbitrary code on the system.
— IBM
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/PyYAMLto a version that resolves this vulnerability.Fixed in 5.3.1 - Upgrade
Upgrade
pip/pyyamlto a version that resolves this vulnerability.Fixed in 5.3.1 - Upgrade
Upgrade
PyYAMLto a version that resolves this vulnerability.Fixed in 5.3.1 - Configuration
When parsing untrusted YAML input, use `yaml.safe_load` or the SafeLoader loader instead of processing via `full_load`/`FullLoader`.
PyYAML YAML parsing loader used for untrusted input = yaml.safe_load or SafeLoader
Event History
Frequently Asked Questions
What is CVE-2020-1747?
CVE-2020-1747 is a vulnerability in the PyYAML library that can allow a remote attacker to execute arbitrary code on the system.
What is the severity level of CVE-2020-1747?
CVE-2020-1747 has a severity level of critical.
How does CVE-2020-1747 affect PyYAML?
CVE-2020-1747 affects PyYAML versions before 5.3.1.
How can an attacker exploit CVE-2020-1747?
An attacker can exploit CVE-2020-1747 by processing untrusted YAML files through the full_load method or with the FullLoader loader.
How can I fix CVE-2020-1747?
To fix CVE-2020-1747, update PyYAML to version 5.3.1 or later.