vulnerability

FreeBSD: VID-aae8fecf-888e-11ea-9714-08002718de91 (CVE-2020-1747): py-yaml -- FullLoader (still) exploitable for arbitrary command execution

Severity
10
CVSS
(AV:N/AC:L/Au:N/C:C/I:C/A:C)
Published
Apr 27, 2020
Added
Apr 28, 2020
Modified
Dec 10, 2025

Description

Riccardo Schirone (https://github.com/ret2libc) reports: In FullLoader python/object/new constructor, implemented by construct_python_object_apply, has support for setting the state of a deserialized instance through the set_python_instance_state method. After setting the state, some operations are performed on the instance to complete its initialization, however it is possible for an attacker to set the instance' state in such a way that arbitrary code is executed by the FullLoader. This patch tries to block such attacks in FullLoader by preventing set_python_instance_state from setting arbitrar properties. It implements a blacklist that includes extend method (called by construct_python_object_apply) and all special methods (e.g. __set__, __setitem__, etc.). Users who need special attributes being set in the state of a deserialized object can still do it through the UnsafeLoader, which however should not be used on untrusted input. Additionally, they can subclass FullLoader and redefine state_blacklist_regexp to include the additional attributes they need, passing the subclassed loader to yaml.load.

Solutions

freebsd-upgrade-package-py27-yamlfreebsd-upgrade-package-py35-yamlfreebsd-upgrade-package-py36-yamlfreebsd-upgrade-package-py37-yamlfreebsd-upgrade-package-py38-yaml
Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.