CVE-2025-40909 Details
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
A race condition vulnerability has been identified in Perl's handling of directory handles within threads. When a directory handle is open and a new thread is created, Perl temporarily changes the current working directory to clone the handle for the new thread. This change can inadvertently affect other threads, leading to file operations being directed to the wrong locations. As a result, a local attacker could exploit this behavior to manipulate file access or execute unintended code. The vulnerability was introduced in Perl version 5.13.6 and affects all versions through 5.40.1.
Users can update to Perl version 5.41.13 or later, where this issue has been fixed. Instructions for updating Perl can be found in the Perl documentation or through the package manager on most systems.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed May 30, 2025CISA-ADP
Assessed May 30, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-426 | Untrusted Search Path | CPANSec |
| CWE-689 | Permission Race Condition During Resource Copy | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| Perl | >= 5.13.6, < 5.41.13 (semver) |
CPE
Remediation
| |
Change History
13 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CPANSec |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 18, 2026 | CVE Modified | CVE |
| Nov 3, 2025 | CVE Modified | CVE |
| Sep 5, 2025 | CVE Modified | CPANSec |
| Jun 3, 2025 | CVE Modified | CVE |
| Jun 3, 2025 | CVE Modified | CVE |
| Jun 2, 2025 | CVE Modified | CVE |
| Jun 2, 2025 | CVE Modified | CVE |
| May 31, 2025 | CVE Modified | CVE |
| May 30, 2025 | CVE Modified | CISA-ADP |
| May 30, 2025 | CVE Modified | CVE |
| May 30, 2025 | New CVE Received | CPANSec |
Volerion