CVE-2025-40909

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

State
Published
Severity
5.9 Medium
Published
May 30, 2025
Updated
Apr 18, 2026
Reserved
Apr 16, 2025

Read the record on cve.org

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

Scores

CVSSScoreVectorSource
3.15.9 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:LCISA-ADP

Weaknesses

  • CWE-689 Permission Race Condition During Resource Copy
  • CWE-426 Untrusted Search Path

Affected Products

ProductVersions
perlperl
  • 5.13.6 to before 5.41.13Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.