Code loading via thread-cloning directory race
Published May 30, 2025 · Updated Apr 18, 2026
Race condition in Perl 5.13.6 through 5.41.12 allows local users to access or load files from unintended paths. Perl_dirp_dup clones an open directory handle by calling fchdir, temporarily changing the process-wide working directory seen by concurrent threads. Exploitation requires an open directory handle during thread creation and a third active thread; resulting relative file operations can read unintended files or load attacker-controlled code.
Summary
What happened
Race condition in Perl 5.13.6 through 5.41.12 allows local users to access or load files from unintended paths. Perl_dirp_dup clones an open directory handle by calling fchdir, temporarily changing the process-wide working directory seen by concurrent threads. Exploitation requires an open directory handle during thread creation and a third active thread; resulting relative file operations can read unintended files or load attacker-controlled code.
The record
- CVE
- CVE-2025-40909
- Published
- May 30, 2025
- Updated
- Apr 18, 2026
- Vendor
- The Perl Foundation
- Product
- Perl
- Classifications
- CWE-362, CWE-426, T1574
- Attack vector
- local
- Privileges
- unauthenticated
Timeline
How it unfolded
- May 30, 2025CVE publishedPublication date reported by the CVE source.
- Apr 18, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=5.13.6 <5.41.13
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Perl directory-handle thread-race reproducerproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo