{"id":"CVE-2025-40909","state":"PUBLISHED","title":"Perl threads have a working directory race condition where file operations may target unintended paths","description":"Perl threads have a working directory race condition where file operations may target unintended paths.\n\nIf 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. \n\nThis may lead to unintended operations such as loading code or accessing files from unexpected locations, which a local attacker may be able to exploit.\n\nThe bug was introduced in commit 11a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6","publishedAt":"2025-05-30T12:20:11.237Z","updatedAt":"2026-04-18T14:15:40.356Z","severity":{"score":5.9,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","source":"CISA-ADP"},"assigner":"CPANSec","products":["perl perl"],"affected":[{"vendor":"perl","product":"perl","packageName":"perl","defaultStatus":"unaffected","versions":[{"version":"5.13.6","status":"affected","lessThan":"5.41.13","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programRoutines":[{"name":"threads"}],"repo":"https://github.com/perl/perl5"}],"references":["https://github.com/Perl/perl5/commit/918bfff86ca8d6d4e4ec5b30994451e0bd74aba9.patch","https://www.openwall.com/lists/oss-security/2025/05/22/2","https://github.com/Perl/perl5/issues/23010","https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098226","https://github.com/Perl/perl5/issues/10387","https://perldoc.perl.org/5.14.0/perl5136delta#Directory-handles-not-copied-to-threads","https://github.com/Perl/perl5/commit/11a11ecf4bea72b17d250cfb43c897be1341861e","http://www.openwall.com/lists/oss-security/2025/05/23/1","http://www.openwall.com/lists/oss-security/2025/05/30/4","http://www.openwall.com/lists/oss-security/2025/06/02/2","http://www.openwall.com/lists/oss-security/2025/06/02/5","http://www.openwall.com/lists/oss-security/2025/06/02/6","http://www.openwall.com/lists/oss-security/2025/06/02/7","http://www.openwall.com/lists/oss-security/2025/06/03/1","http://seclists.org/fulldisclosure/2025/Sep/55","http://seclists.org/fulldisclosure/2025/Sep/54","http://seclists.org/fulldisclosure/2025/Sep/53","https://lists.debian.org/debian-lts-announce/2026/04/msg00018.html"],"weaknesses":["CWE-689","CWE-426"],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40909.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40909","state":"PUBLISHED","datePublished":"2025-05-30T12:20:11.237Z","dateUpdated":"2026-04-18T14:15:40.356Z","assignerShortName":"CPANSec","assignerOrgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateReserved":"2025-04-16T09:05:34.360Z"},"containers":{"cna":{"title":"Perl threads have a working directory race condition where file operations may target unintended paths","descriptions":[{"lang":"en","value":"Perl threads have a working directory race condition where file operations may target unintended paths.\n\nIf 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. \n\nThis may lead to unintended operations such as loading code or accessing files from unexpected locations, which a local attacker may be able to exploit.\n\nThe bug was introduced in commit 11a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6"}],"affected":[{"vendor":"perl","product":"perl","packageName":"perl","defaultStatus":"unaffected","versions":[{"version":"5.13.6","status":"affected","lessThan":"5.41.13","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programRoutines":[{"name":"threads"}],"repo":"https://github.com/perl/perl5"}],"references":[{"url":"https://github.com/Perl/perl5/commit/918bfff86ca8d6d4e4ec5b30994451e0bd74aba9.patch","tags":["patch"]},{"url":"https://www.openwall.com/lists/oss-security/2025/05/22/2","tags":["mailing-list","exploit"]},{"url":"https://github.com/Perl/perl5/issues/23010","tags":["issue-tracking"]},{"url":"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098226","tags":["related"]},{"url":"https://github.com/Perl/perl5/issues/10387","tags":["related"]},{"url":"https://perldoc.perl.org/5.14.0/perl5136delta#Directory-handles-not-copied-to-threads","tags":["related"]},{"url":"https://github.com/Perl/perl5/commit/11a11ecf4bea72b17d250cfb43c897be1341861e","tags":["related"]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-689","description":"CWE-689 Permission Race Condition During Resource Copy","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-426","description":"CWE-426 Untrusted Search Path","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"CPANSec","orgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateUpdated":"2025-09-05T13:24:00.827Z"},"credits":[{"lang":"en","type":"finder","value":"Vincent Lefevre"}],"solutions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"Update perl to an unaffected version, or apply the patch provided in the references section."}],"value":"Update perl to an unaffected version, or apply the patch provided in the references section."}],"source":{"discovery":"UNKNOWN"},"x_generator":{"engine":"Vulnogram 0.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"http://www.openwall.com/lists/oss-security/2025/05/23/1"},{"url":"http://www.openwall.com/lists/oss-security/2025/05/30/4"},{"url":"http://www.openwall.com/lists/oss-security/2025/06/02/2"},{"url":"http://www.openwall.com/lists/oss-security/2025/06/02/5"},{"url":"http://www.openwall.com/lists/oss-security/2025/06/02/6"},{"url":"http://www.openwall.com/lists/oss-security/2025/06/02/7"},{"url":"http://www.openwall.com/lists/oss-security/2025/06/03/1"},{"url":"http://seclists.org/fulldisclosure/2025/Sep/55"},{"url":"http://seclists.org/fulldisclosure/2025/Sep/54"},{"url":"http://seclists.org/fulldisclosure/2025/Sep/53"},{"url":"https://lists.debian.org/debian-lts-announce/2026/04/msg00018.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2026-04-18T14:15:40.356Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":5.9,"attackVector":"LOCAL","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","integrityImpact":"LOW","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"LOW","privilegesRequired":"NONE","confidentialityImpact":"LOW"}},{"other":{"type":"ssvc","content":{"timestamp":"2025-05-30T14:05:00.839656Z","id":"CVE-2025-40909","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-05-30T14:09:50.842Z"}}]}}}