CVE-2025-40909 Perl threads have a working directory race condition where file operations may target unintended paths
A local attacker can exploit a race condition in Perl threads to execute code or read files from unintended paths.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-40909?
CVE-2025-40909 is a medium-severity vulnerability in perl, published on 30 May 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
Perl threads have a working directory race condition where file operations may target unintended paths.
If a directory handle is open at thread creation, the process-wide current working directory is temporarily changed in order to clone that handle for the new thread, which is visible from any third (or more) thread already running.
This may lead to unintended operations such as loading code or accessing files from unexpected locations, which a local attacker may be able to exploit.
The bug was introduced in commit 11a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6
Which versions are affected by CVE-2025-40909?
Linux distribution packages (40)
perl AlmaLinux:8 | All versions | 4:5.26.3-423.el8_10 |
perl AlmaLinux:8 | All versions | 4:5.32.1-474.module_el8.10.0+4162+0aac7c4c |
perl-Algorithm-Diff AlmaLinux:8 | All versions | 1.1903-10.module_el8.6.0+2766+8bf0b7ce |
perl-Archive-Tar AlmaLinux:8 | All versions | 2.38-3.module_el8.6.0+2766+8bf0b7ce |
perl-Archive-Zip AlmaLinux:8 | All versions | 1.68-3.module_el8.6.0+2766+8bf0b7ce |
perl-Attribute-Handlers AlmaLinux:8 | All versions | 0.99-423.el8_10 |
perl-Attribute-Handlers AlmaLinux:8 | All versions | 1.01-474.module_el8.10.0+4162+0aac7c4c |
perl-AutoLoader AlmaLinux:8 | All versions | 5.74-474.module_el8.10.0+4162+0aac7c4c |
perl-AutoSplit AlmaLinux:8 | All versions | 5.74-474.module_el8.10.0+4162+0aac7c4c |
perl-B AlmaLinux:8 | All versions | 1.80-474.module_el8.10.0+4162+0aac7c4c |
perl-Benchmark AlmaLinux:8 | All versions | 1.23-474.module_el8.10.0+4162+0aac7c4c |
perl-CPAN AlmaLinux:8 | All versions | 2.28-5.module_el8.6.0+2766+8bf0b7ce |
perl-CPAN-DistnameInfo AlmaLinux:8 | All versions | 0.12-13.module_el8.6.0+2766+8bf0b7ce |
perl-CPAN-Meta AlmaLinux:8 | All versions | 2.150010-397.module_el8.6.0+2766+8bf0b7ce |
perl-CPAN-Meta-Requirements AlmaLinux:8 | All versions | 2.140-397.module_el8.6.0+2766+8bf0b7ce |
perl-CPAN-Meta-YAML AlmaLinux:8 | All versions | 0.018-1001.module_el8.6.0+2766+8bf0b7ce |
perl-Carp AlmaLinux:8 | All versions | 1.50-439.module_el8.6.0+2766+8bf0b7ce |
perl-Class-Struct AlmaLinux:8 | All versions | 0.66-474.module_el8.10.0+4162+0aac7c4c |
perl-Compress-Bzip2 AlmaLinux:8 | All versions | 2.28-2.module_el8.6.0+2766+8bf0b7ce |
perl-Compress-Bzip2 AlmaLinux:8 | All versions | 2.28-2.module_el8.6.0+3181+91434291 |
perl-Compress-Raw-Bzip2 AlmaLinux:8 | All versions | 2.096-1.module_el8.6.0+2766+8bf0b7ce |
perl-Compress-Raw-Bzip2 AlmaLinux:8 | All versions | 2.096-1.module_el8.6.0+3181+91434291 |
perl-Compress-Raw-Lzma AlmaLinux:8 | All versions | 2.096-1.module_el8.6.0+2766+8bf0b7ce |
perl-Compress-Raw-Lzma AlmaLinux:8 | All versions | 2.096-1.module_el8.6.0+3181+91434291 |
perl-Compress-Raw-Zlib AlmaLinux:8 | All versions | 2.096-2.module_el8.10.0+3779+d5938d28 |
perl-Config-Extensions AlmaLinux:8 | All versions | 0.03-474.module_el8.10.0+4162+0aac7c4c |
perl-Config-Perl-V AlmaLinux:8 | All versions | 0.32-441.module_el8.6.0+2766+8bf0b7ce |
perl-DBM_Filter AlmaLinux:8 | All versions | 0.06-474.module_el8.10.0+4162+0aac7c4c |
perl-DB_File AlmaLinux:8 | All versions | 1.855-1.module_el8.6.0+2766+8bf0b7ce |
perl-DB_File AlmaLinux:8 | All versions | 1.855-1.module_el8.6.0+3181+91434291 |
perl-Data-Dumper AlmaLinux:8 | All versions | 2.174-440.module_el8.6.0+2766+8bf0b7ce |
perl-Data-Dumper AlmaLinux:8 | All versions | 2.174-440.module_el8.6.0+3181+91434291 |
perl-Data-OptList AlmaLinux:8 | All versions | 0.110-7.module_el8.6.0+2766+8bf0b7ce |
perl-Data-Section AlmaLinux:8 | All versions | 0.200007-8.module_el8.6.0+2766+8bf0b7ce |
perl-Devel-PPPort AlmaLinux:8 | All versions | 3.62-1.module_el8.6.0+2766+8bf0b7ce |
perl-Devel-PPPort AlmaLinux:8 | All versions | 3.62-1.module_el8.6.0+3181+91434291 |
perl-Devel-Peek AlmaLinux:8 | All versions | 1.26-423.el8_10 |
perl-Devel-Peek AlmaLinux:8 | All versions | 1.28-474.module_el8.10.0+4162+0aac7c4c |
perl-Devel-SelfStubber AlmaLinux:8 | All versions | 1.06-423.el8_10 |
perl-Devel-SelfStubber AlmaLinux:8 | All versions | 1.06-474.module_el8.10.0+4162+0aac7c4c |
How do I fix CVE-2025-40909?
Apply the vendor's patch.
Is CVE-2025-40909 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-40909 exists.
Sources
Also known as ALSA-2025:11805, ALSA-2026:8096, AZL-62067, AZL-62069, BELL-CVE-2025-40909, CLSA-2025-1755270634 and 26 more.