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.
Published: 2026-10-05
Score: 7.4 High
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary Code Execution
Action: Immediate Patch
AI Analysis

Impact

YAML versions before 1.30 for Perl permit an attacker to craft a YAML document that triggers the DESTROY method of any class that the process has loaded. The YAML processor blesses a hash into the specified class; when the document's object goes out of scope Perl invokes DESTROY. Depending on the class, that method can perform destructive actions such as deleting files or executing arbitrary code. For example, with File::Temp::Dir from core Perl, DESTROY removes an entire directory tree that the document names, leading to data loss or service interruption.

Affected Systems

Perl installations that use the YAML module in any version earlier than 1.30 are susceptible. The vulnerability is present in the standard CPAN YAML package and affects any application that loads untrusted YAML documents without preventing object deserialization.

Risk and Exploitability

The vulnerability can be exploited by an attacker who can supply a crafted YAML file to an application. The CVSS score of 7.4 indicates a high severity. A successful exploit may lead to arbitrary code execution or destructive file system operations, depending on the classes loaded in the process. The EPSS score is not available, and the vulnerability is not listed in CISA KEV, but the lack of a mitigation path and the potential for serious impact warrant immediate attention. The documented workaround—setting $YAML::LoadBlessed = 0 before loading untrusted input—reduces the risk by preventing arbitrary classes from being instantiated, though it remains a temporary measure until an upgrade can be performed.

Generated by OpenCVE AI on October 5, 2026 at 13:22 UTC.

Remediation

Vendor Solution

Upgrade to YAML 1.30 or later.


Vendor Workaround

For deployments that cannot upgrade to YAML 1.30, set $YAML::LoadBlessed = 0 before loading untrusted input. The option exists from YAML 1.25.


OpenCVE Recommended Actions

  • Upgrade to YAML 1.30 or later.
  • If upgrading is not immediately possible, set $YAML::LoadBlessed = 0 before loading untrusted YAML documents to block arbitrary class instantiation.
  • Avoid loading untrusted YAML content in production and validate that all input originates from trusted sources before parsing.

Generated by OpenCVE AI on October 5, 2026 at 13:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 05 Oct 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H'}

threat_severity

Important


Mon, 05 Oct 2026 07:00:00 +0000

Type Values Removed Values Added
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.
Title YAML versions before 1.30 for Perl allow a loaded document to trigger the DESTROY method of arbitrary classes
Weaknesses CWE-470
CWE-502
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-10-05T06:49:17.583Z

Reserved: 2026-09-21T21:18:28.499Z

Link: CVE-2017-20285

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-05T07:16:29.017

Modified: 2026-10-05T07:16:29.017

Link: CVE-2017-20285

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-05T06:49:17Z

Links: CVE-2017-20285 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-05T13:30:19Z

Weaknesses
  • CWE-470

    Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

  • CWE-502

    Deserialization of Untrusted Data