CVE-2017-20285YAML versions before 1.30 for Perl allow a loaded document to trigger the DESTROY method…
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.
What to do
Fixed builds are available from AlmaLinux, Debian, Red Hat, Rocky Linux: see the table below for the fixed version per release.
Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | libyaml-perl | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | libyaml-perl | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | libyaml-perl | Fix pending | 1.24-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2017-20285 |
| Ubuntu 16.04 | libyaml-perl | Fix pending | 1.15-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2017-20285 |
| Debian 14 | libyaml-perl | Fixed | 1.30-1 | DEBIAN-CVE-2017-20285 |
| Debian 13 | libyaml-perl | Fixed | 1.30-1 | DEBIAN-CVE-2017-20285 |
| Debian 12 | libyaml-perl | Fixed | 1.30-1 | DEBIAN-CVE-2017-20285 |
| Red Hat Enterprise Linux 10 | perl-YAML | Not affected | ||
| Red Hat Enterprise Linux 9 | perl-YAML | Not affected | ||
| Red Hat Enterprise Linux 8 | perl-YAML | Fixed | 0:1.24-4.module+el8.10.0+25073+d1062575 | RHSA-2026:93471 |
| Red Hat Enterprise Linux 7 | perl-YAML | Fix pending Affected | ||
| Red Hat Enterprise Linux 6 | perl-YAML | Not affected | ||
| AlmaLinux 8 | perl-YAML | Fixed | 1.24-4.module_el8.10.0+4341+ab0ec422 | ALSA-2026:93471 |
| Rocky Linux 8 | perl-YAML | Fixed | 0:1.24-4.module+el8.10.0+40403+9457ea6c | RLSA-2026:93471 |
What the vendor says
As published in the CVE record by CPANSec, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- YAML: affected: before 1.30; fixed in
1.30
Solution: Upgrade to YAML 1.30 or later.
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.
Vendor advisories:
- https://github.com/ingydotnet/yaml-pm/commit/471314bbdcbd62077eea32755929122aa8bd00a3.pat… (patch)
- https://github.com/ingydotnet/yaml-pm/commit/7736f38bd02e4f9f77d5468721e3be3d7b34a8ec.pat… (patch)
- https://metacpan.org/release/TINITA/YAML-1.30/changes (release-notes)
References
- https://github.com/ingydotnet/yaml-pm/issues/176
- https://github.com/ingydotnet/yaml-pm/commit/471314bbdcbd62077eea32755929122aa8bd00a3.patch
- https://github.com/ingydotnet/yaml-pm/commit/7736f38bd02e4f9f77d5468721e3be3d7b34a8ec.patch
- https://metacpan.org/release/TINITA/YAML-1.30/changes
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.