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
Published: 2025-05-30
Score: 5.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Unintended file operations potentially leading to code execution or data exposure
Action: Update Perl
AI Analysis

Impact

A race condition exists during thread creation when a directory handle is open. The process-wide current working directory is temporarily altered to clone that handle for the new thread, an effect that is visible to any other threads already running. This flaw can cause file operations—such as loading code or reading data—to target unintended paths. The weakness is identified by CWE-362 (Race Condition), CWE-426 (Insecure Direct Object Reference), and CWE-689 (Improper Handling of Working Directory). The result is a localized attack surface that may allow a local adversary to execute arbitrary code or read/write files that should not be accessible.

Affected Systems

The vulnerability affects the Perl interpreter provided by the https://perl.org organization, specifically the 5.13.6 release. Versions that incorporate the referenced patch or any later revision that eliminates the race condition are considered unaffected. No other vendors or product lines are listed as impacted.

Risk and Exploitability

The CVSS score of 5.9 indicates moderate severity, and the EPSS score of less than 1% reflects a very low exploitation probability. The vulnerability is not listed in the CISA KEV catalog. Likely attack vectors involve a local attacker who can spawn threads within the same process; they would need to coordinate timing to exploit the directory change. Because the flaw requires a concurrent thread and the resulting privilege is limited to the running process, the risk is medium but still significant for components handling sensitive file paths.

Generated by OpenCVE AI on April 20, 2026 at 15:33 UTC.

Remediation

Vendor Solution

Update perl to an unaffected version, or apply the patch provided in the references section.


OpenCVE Recommended Actions

  • Upgrade Perl to a release that incorporates the fix for 5.13.6; refer to vendor advisories for the safe version
  • If upgrading is not immediately possible, apply the specific patch provided in the vendor references to patch the race condition
  • For applications that cannot be patched, restructure code so that no directory handles are opened before threads are created or set the working directory explicitly for each thread, thereby preventing unintended path resolution

Generated by OpenCVE AI on April 20, 2026 at 15:33 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4538-1 perl security update
EUVD EUVD EUVD-2025-16506 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
Ubuntu USN Ubuntu USN USN-7678-1 Perl vulnerability
History

Sat, 18 Apr 2026 15:30:00 +0000

Type Values Removed Values Added
References

Mon, 03 Nov 2025 19:30:00 +0000


Fri, 05 Sep 2025 13:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-689

Sun, 13 Jul 2025 13:45:00 +0000

Type Values Removed Values Added
Metrics epss

{'score': 0.00017}

epss

{'score': 6e-05}


Tue, 03 Jun 2025 04:30:00 +0000

Type Values Removed Values Added
References

Tue, 03 Jun 2025 02:30:00 +0000

Type Values Removed Values Added
References

Mon, 02 Jun 2025 20:30:00 +0000


Mon, 02 Jun 2025 11:30:00 +0000

Type Values Removed Values Added
References

Sat, 31 May 2025 03:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Sat, 31 May 2025 01:30:00 +0000

Type Values Removed Values Added
References

Fri, 30 May 2025 21:45:00 +0000

Type Values Removed Values Added
References

Fri, 30 May 2025 14:15:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 30 May 2025 12:45:00 +0000

Type Values Removed Values Added
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
Title Perl threads have a working directory race condition where file operations may target unintended paths
Weaknesses CWE-362
CWE-426
References

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-04-18T14:15:40.356Z

Reserved: 2025-04-16T09:05:34.360Z

Link: CVE-2025-40909

cve-icon Vulnrichment

Updated: 2026-04-18T14:15:40.356Z

cve-icon NVD

Status : Deferred

Published: 2025-05-30T13:15:22.350

Modified: 2026-04-18T15:16:18.460

Link: CVE-2025-40909

cve-icon Redhat

Severity : Moderate

Publid Date: 2025-05-30T12:20:11Z

Links: CVE-2025-40909 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-20T15:45:10Z

Weaknesses