---
id: CVE-2017-20285
title: >-
  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
summary: >-
  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 DESTR…
severity: critical
cvss: 9.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'
cwe:
  - CWE-470
  - CWE-502
product: YAML
affected:
  - YAML < 1.30
published: '2026-10-05'
updated: '2026-10-06'
sourceUpdated: '2026-10-06T17:17:08.657'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2017-20285'
references:
  - url: >-
      https://github.com/ingydotnet/yaml-pm/commit/471314bbdcbd62077eea32755929122aa8bd00a3.patch
    label: 9b29abf9-4ab0-4765-b253-1875cd9b441e
  - url: >-
      https://github.com/ingydotnet/yaml-pm/commit/7736f38bd02e4f9f77d5468721e3be3d7b34a8ec.patch
    label: 9b29abf9-4ab0-4765-b253-1875cd9b441e
  - url: 'https://github.com/ingydotnet/yaml-pm/issues/176'
    label: 9b29abf9-4ab0-4765-b253-1875cd9b441e
  - url: 'https://metacpan.org/release/TINITA/YAML-1.30/changes'
    label: 9b29abf9-4ab0-4765-b253-1875cd9b441e
  - url: 'http://www.openwall.com/lists/oss-security/2026/10/05/8'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2017/cve-2017-20285.json
  - url: 'https://access.redhat.com/security/cve/CVE-2017-20285'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2545820'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2017-20285'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2017-20285'
tags:
  - nvd
  - cve.org
  - csaf
  - vex
  - red-hat
ssvc:
  exploitation: none
  automatable: 'yes'
  technicalImpact: total
  timestamp: '2026-10-06T17:02:52.193961Z'
epss: 0.0034
epssPercentile: 0.27318
ingestedAt: '2026-10-05T07:14:48.254Z'
vendor: Red Hat
scores:
  nvd: 9.1
  vendor: 7.4
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **Red Hat VEX** · Important · affected: Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9 · no fix planned: Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9 · updated 2026-10-06 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2017/cve-2017-20285.json)
