CVE-2025-40908 YAML-LibYAML prior to 0.903.0 for Perl uses 2-args open, allowing existing files to be modified

Critical 9.1 Published Updated

An attacker can modify existing files by exploiting unsafe file opening practices in the YAML-LibYAML Perl library.

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

What is CVE-2025-40908?

CVE-2025-40908 is a critical path traversal vulnerability in TINITA YAML::LibYAML, published on 1 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

YAML-LibYAML prior to 0.903.0 for Perl uses 2-args open, allowing existing files to be modified

Weakness: CWE-552

Which versions are affected by CVE-2025-40908?

It affects 1 product.

Linux distribution packages (21)
perl-YAML-LibYAML AlmaLinux:8All versions1:0.70-2.el8_10
perl-YAML-LibYAML AlmaLinux:9All versions1:0.82-6.1.el9_6
perl-YAML-LibYAML Red Hat:enterprise_linux:8::crbAll versions1:0.70-2.el8_10
perl-YAML-LibYAML-debuginfo Red Hat:enterprise_linux:8::crbAll versions1:0.70-2.el8_10
perl-YAML-LibYAML-debugsource Red Hat:enterprise_linux:8::crbAll versions1:0.70-2.el8_10
perl-YAML-LibYAML Red Hat:enterprise_linux:9::crbAll versions1:0.82-6.1.el9_6
perl-YAML-LibYAML-debuginfo Red Hat:enterprise_linux:9::crbAll versions1:0.82-6.1.el9_6
perl-YAML-LibYAML-debugsource Red Hat:enterprise_linux:9::crbAll versions1:0.82-6.1.el9_6
perl-YAML-LibYAML Red Hat:rhel_eus:9.4::crbAll versions1:0.82-6.el9_4.1
perl-YAML-LibYAML-debuginfo Red Hat:rhel_eus:9.4::crbAll versions1:0.82-6.el9_4.1
perl-YAML-LibYAML-debugsource Red Hat:rhel_eus:9.4::crbAll versions1:0.82-6.el9_4.1
perl-YAML-LibYAML Rocky Linux:8All versions1:0.70-2.el8_10
perl-YAML-LibYAML Rocky Linux:9All versions1:0.82-6.1.el9_6
perl-YAML-LibYAML SUSE:Linux Enterprise Module for Development Tools 15 SP6All versions0.890.0-150000.3.11.1
perl-YAML-LibYAML SUSE:Linux Enterprise Module for Development Tools 15 SP6All versions0.904.0-150000.3.16.1
perl-YAML-LibYAML SUSE:Linux Enterprise Module for Development Tools 15 SP7All versions0.904.0-150000.3.16.1
perl-YAML-LibYAML SUSE:Linux Enterprise Server 12 SP5-LTSSAll versions0.38-11.3.1
perl-YAML-LibYAML SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5All versions0.38-11.3.1
perl-YAML-LibYAML openSUSE:Leap 15.6All versions0.890.0-150000.3.11.1
perl-YAML-LibYAML openSUSE:Leap 15.6All versions0.904.0-150000.3.16.1
perl-YAML-LibYAML openSUSE:TumbleweedAll versions0.904.0-2.1

Products include Ingydotnet Yaml-Libyaml.

How do I fix CVE-2025-40908?

Upgrade to a fixed version.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-40908 being exploited?

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

Sources

Also known as ALSA-2025:9329, ALSA-2025:9330, AZL-62242, AZL-62279, DEBIAN-CVE-2025-40908, GHSA-jh9m-3m95-c6hp and 15 more.

Is CVE-2025-40908 in your software?

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

Check your SBOMs for free