CVE-2017-20285 YAML versions before 1.30 for Perl allow a loaded document to trigger the DESTROY method of arbitrary classes

Critical 9.1 Published Updated

Attackers can execute arbitrary code or delete files by crafting malicious YAML documents that trigger unsafe DESTROY methods in Perl applications.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2017-20285?

CVE-2017-20285 is a critical unsafe deserialization vulnerability, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

YAML versions before 1.30 for Perl allow a loaded document to trigger the DESTROY method of arbitrary classes.

A perl/hash:Class tag blesses a hash into the class it names. The document supplies the object's fields, and Perl calls DESTROY when it goes out of scope.

What DESTROY does depends on the classes the process has loaded. With File::Temp::Dir from core Perl, it can delete a directory tree the document names.

Weakness: CWE-502, CWE-470

Which versions are affected by CVE-2017-20285?

How do I fix CVE-2017-20285?

Upgrade to a fixed version.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2017-20285 being exploited?

There is no known exploitation of CVE-2017-20285 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2017-20285, GHSA-c454-fc94-q86x, UBUNTU-CVE-2017-20285.

Is CVE-2017-20285 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free