CVE-2025-40909

Perl threads have a working directory race condition where file operations may target unintended paths

Published May 30, 2025 CVSS 3.1 · 5.9 Medium EPSS < 1% KEV · Not listed
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

Remediation

Vendor Solution

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

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
Type Values Removed Values Added
Weaknesses CWE-689
Type Values Removed Values Added
Metrics epss

{'score': 0.00017}

epss

{'score': 6e-05}

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'}

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
Weaknesses

Sources

Status
PUBLISHED
Assigner
CPANSec
Published
Updated
Apr 18, 2026, 2:15 PM
Reserved
Apr 16, 2025, 9:05 AM
Status
Deferred
Published
May 30, 2025, 1:15 PM
Modified
Jun 17, 2026, 9:22 AM
Severity
Moderate
Public date
May 30, 2025, 12:20 PM