Perl threads have a working directory race condition where file operations may target unintended paths
Summary
| CVE | CVE-2025-40909 |
|---|---|
| State | PUBLISHED |
| Assigner | CPANSec |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2025-05-30 13:15:22 UTC |
| Updated | 2026-04-18 15:16:18 UTC |
| 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 |
Risk And Classification
Primary CVSS: v3.1 5.9 MEDIUM from ADP
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
EPSS: 0.000340000 probability, percentile 0.096450000 (date 2026-04-18)
Problem Types: CWE-426 | CWE-689 | CWE-689 CWE-689 Permission Race Condition During Resource Copy | CWE-426 CWE-426 Untrusted Search Path
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | ADP | DECLARED | 5.9 | MEDIUM | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
| 3.1 | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | Secondary | 5.9 | MEDIUM | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
CVSS v3.1 Breakdown
Attack Vector
LocalAttack Complexity
LowPrivileges Required
NoneUser Interaction
NoneScope
UnchangedConfidentiality
LowIntegrity
LowAvailability
LowCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Vendor Declared Affected Products
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| www.openwall.com/lists/oss-security/2025/06/02/5 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| bugs.debian.org/cgi-bin/bugreport.cgi | 9b29abf9-4ab0-4765-b253-1875cd9b441e | bugs.debian.org | |
| www.openwall.com/lists/oss-security/2025/05/22/2 | 9b29abf9-4ab0-4765-b253-1875cd9b441e | www.openwall.com | |
| www.openwall.com/lists/oss-security/2025/06/02/7 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| seclists.org/fulldisclosure/2025/Sep/53 | af854a3a-2127-422b-91ae-364da2661108 | seclists.org | |
| www.openwall.com/lists/oss-security/2025/06/02/6 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| github.com/Perl/perl5/commit/11a11ecf4bea72b17d250cfb43c897be1341861e | 9b29abf9-4ab0-4765-b253-1875cd9b441e | github.com | |
| lists.debian.org/debian-lts-announce/2026/04/msg00018.html | af854a3a-2127-422b-91ae-364da2661108 | lists.debian.org | |
| www.openwall.com/lists/oss-security/2025/06/02/2 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| seclists.org/fulldisclosure/2025/Sep/54 | af854a3a-2127-422b-91ae-364da2661108 | seclists.org | |
| www.openwall.com/lists/oss-security/2025/05/23/1 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| github.com/Perl/perl5/commit/918bfff86ca8d6d4e4ec5b30994451e0bd74aba9.patch | 9b29abf9-4ab0-4765-b253-1875cd9b441e | github.com | |
| www.openwall.com/lists/oss-security/2025/06/03/1 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| www.openwall.com/lists/oss-security/2025/05/30/4 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | |
| perldoc.perl.org/5.14.0/perl5136delta | 9b29abf9-4ab0-4765-b253-1875cd9b441e | perldoc.perl.org | |
| github.com/Perl/perl5/issues/10387 | 9b29abf9-4ab0-4765-b253-1875cd9b441e | github.com | |
| github.com/Perl/perl5/issues/23010 | 9b29abf9-4ab0-4765-b253-1875cd9b441e | github.com | |
| seclists.org/fulldisclosure/2025/Sep/55 | af854a3a-2127-422b-91ae-364da2661108 | seclists.org | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Vincent Lefevre (en)
Additional Advisory Data
Solutions
CNA: Update perl to an unaffected version, or apply the patch provided in the references section.
There are currently no legacy QID mappings associated with this CVE.