CVE-2025-40909 (GCVE-0-2025-40909)

Vulnerability from cvelistv5 – Published: 2025-05-30 12:20 – Updated: 2025-11-03 18:09
VLAI?
Summary
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
CWE
  • CWE-689 - Permission Race Condition During Resource Copy
  • CWE-426 - Untrusted Search Path
Assigner
Impacted products
Vendor Product Version
perl perl Affected: 5.13.6 , < 5.41.13 (custom)
Create a notification for this product.
Credits
Vincent Lefevre
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T18:09:27.894Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "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"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "LOCAL",
              "availabilityImpact": "LOW",
              "baseScore": 5.9,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "LOW",
              "integrityImpact": "LOW",
              "privilegesRequired": "NONE",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2025-40909",
                "options": [
                  {
                    "Exploitation": "poc"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-05-30T14:05:00.839656Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-05-30T14:09:50.842Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "collectionURL": "https://cpan.org/modules",
          "defaultStatus": "unaffected",
          "packageName": "perl",
          "product": "perl",
          "programRoutines": [
            {
              "name": "threads"
            }
          ],
          "repo": "https://github.com/perl/perl5",
          "vendor": "perl",
          "versions": [
            {
              "lessThan": "5.41.13",
              "status": "affected",
              "version": "5.13.6",
              "versionType": "custom"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "value": "Vincent Lefevre"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "Perl threads have a working directory race condition where file operations may target unintended paths.\u003cbr\u003e\u003cbr\u003eIf a directory handle is open at thread creation, the process-wide current working directory is temporarily changed in order to clone\u0026nbsp;that handle for the new thread, which is visible from any third (or\u0026nbsp;more) thread already running. \u003cbr\u003e\u003cbr\u003eThis may lead to unintended operations\u0026nbsp;such as loading code or accessing files from unexpected locations,\u0026nbsp;which a local attacker may be able to exploit.\u003cbr\u003e\u003cbr\u003eThe bug was introduced in commit\u0026nbsp;11a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6"
            }
          ],
          "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\u00a0that handle for the new thread, which is visible from any third (or\u00a0more) thread already running. \n\nThis may lead to unintended operations\u00a0such as loading code or accessing files from unexpected locations,\u00a0which a local attacker may be able to exploit.\n\nThe bug was introduced in commit\u00a011a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6"
        }
      ],
      "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": {
        "dateUpdated": "2025-09-05T13:24:00.827Z",
        "orgId": "9b29abf9-4ab0-4765-b253-1875cd9b441e",
        "shortName": "CPANSec"
      },
      "references": [
        {
          "tags": [
            "patch"
          ],
          "url": "https://github.com/Perl/perl5/commit/918bfff86ca8d6d4e4ec5b30994451e0bd74aba9.patch"
        },
        {
          "tags": [
            "mailing-list",
            "exploit"
          ],
          "url": "https://www.openwall.com/lists/oss-security/2025/05/22/2"
        },
        {
          "tags": [
            "issue-tracking"
          ],
          "url": "https://github.com/Perl/perl5/issues/23010"
        },
        {
          "tags": [
            "related"
          ],
          "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"
        }
      ],
      "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"
      },
      "title": "Perl threads have a working directory race condition where file operations may target unintended paths",
      "x_generator": {
        "engine": "Vulnogram 0.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "9b29abf9-4ab0-4765-b253-1875cd9b441e",
    "assignerShortName": "CPANSec",
    "cveId": "CVE-2025-40909",
    "datePublished": "2025-05-30T12:20:11.237Z",
    "dateReserved": "2025-04-16T09:05:34.360Z",
    "dateUpdated": "2025-11-03T18:09:27.894Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40909\",\"sourceIdentifier\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\",\"published\":\"2025-05-30T13:15:22.350\",\"lastModified\":\"2025-11-03T19:15:52.563\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"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\u00a0that handle for the new thread, which is visible from any third (or\u00a0more) thread already running. \\n\\nThis may lead to unintended operations\u00a0such as loading code or accessing files from unexpected locations,\u00a0which a local attacker may be able to exploit.\\n\\nThe bug was introduced in commit\u00a011a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6\"},{\"lang\":\"es\",\"value\":\"Los subprocesos de Perl tienen una condici\u00f3n de ejecuci\u00f3n en el directorio de trabajo donde las operaciones con archivos pueden dirigirse a rutas no deseadas. Si un identificador de directorio est\u00e1 abierto al crear el subproceso, el directorio de trabajo actual de todo el proceso se modifica temporalmente para clonar dicho identificador para el nuevo subproceso, visible desde cualquier tercer subproceso (o m\u00e1s) en ejecuci\u00f3n. Esto puede provocar operaciones no deseadas, como la carga de c\u00f3digo o el acceso a archivos desde ubicaciones inesperadas, que un atacante local podr\u00eda explotar. El error se introdujo en el commit 11a11ecf4bea72b17d250cfb43c897be1341861e y se public\u00f3 en la versi\u00f3n 5.13.6 de Perl.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"134c704f-9b21-4f2e-91b3-4a467353bcc0\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L\",\"baseScore\":5.9,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"LOW\",\"integrityImpact\":\"LOW\",\"availabilityImpact\":\"LOW\"},\"exploitabilityScore\":2.5,\"impactScore\":3.4}]},\"weaknesses\":[{\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\",\"type\":\"Secondary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-426\"},{\"lang\":\"en\",\"value\":\"CWE-689\"}]}],\"references\":[{\"url\":\"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098226\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"https://github.com/Perl/perl5/commit/11a11ecf4bea72b17d250cfb43c897be1341861e\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"https://github.com/Perl/perl5/commit/918bfff86ca8d6d4e4ec5b30994451e0bd74aba9.patch\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"https://github.com/Perl/perl5/issues/10387\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"https://github.com/Perl/perl5/issues/23010\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"https://perldoc.perl.org/5.14.0/perl5136delta#Directory-handles-not-copied-to-threads\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"https://www.openwall.com/lists/oss-security/2025/05/22/2\",\"source\":\"9b29abf9-4ab0-4765-b253-1875cd9b441e\"},{\"url\":\"http://seclists.org/fulldisclosure/2025/Sep/53\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://seclists.org/fulldisclosure/2025/Sep/54\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://seclists.org/fulldisclosure/2025/Sep/55\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/05/23/1\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/05/30/4\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/06/02/2\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/06/02/5\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/06/02/6\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/06/02/7\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"http://www.openwall.com/lists/oss-security/2025/06/03/1\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
    "vulnrichment": {
      "containers": "{\"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\"}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2025-11-03T18:09:27.894Z\"}}, {\"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\": {\"id\": \"CVE-2025-40909\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"poc\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-05-30T14:05:00.839656Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-05-30T14:09:40.567Z\"}}], \"cna\": {\"title\": \"Perl threads have a working directory race condition where file operations may target unintended paths\", \"source\": {\"discovery\": \"UNKNOWN\"}, \"credits\": [{\"lang\": \"en\", \"type\": \"finder\", \"value\": \"Vincent Lefevre\"}], \"affected\": [{\"repo\": \"https://github.com/perl/perl5\", \"vendor\": \"perl\", \"product\": \"perl\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.13.6\", \"lessThan\": \"5.41.13\", \"versionType\": \"custom\"}], \"packageName\": \"perl\", \"collectionURL\": \"https://cpan.org/modules\", \"defaultStatus\": \"unaffected\", \"programRoutines\": [{\"name\": \"threads\"}]}], \"solutions\": [{\"lang\": \"en\", \"value\": \"Update perl to an unaffected version, or apply the patch provided in the references section.\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"Update perl to an unaffected version, or apply the patch provided in the references section.\", \"base64\": false}]}], \"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\"]}], \"x_generator\": {\"engine\": \"Vulnogram 0.2.0\"}, \"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\\u00a0that handle for the new thread, which is visible from any third (or\\u00a0more) thread already running. \\n\\nThis may lead to unintended operations\\u00a0such as loading code or accessing files from unexpected locations,\\u00a0which a local attacker may be able to exploit.\\n\\nThe bug was introduced in commit\\u00a011a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"Perl threads have a working directory race condition where file operations may target unintended paths.\u003cbr\u003e\u003cbr\u003eIf a directory handle is open at thread creation, the process-wide current working directory is temporarily changed in order to clone\u0026nbsp;that handle for the new thread, which is visible from any third (or\u0026nbsp;more) thread already running. \u003cbr\u003e\u003cbr\u003eThis may lead to unintended operations\u0026nbsp;such as loading code or accessing files from unexpected locations,\u0026nbsp;which a local attacker may be able to exploit.\u003cbr\u003e\u003cbr\u003eThe bug was introduced in commit\u0026nbsp;11a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6\", \"base64\": false}]}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-689\", \"description\": \"CWE-689 Permission Race Condition During Resource Copy\"}]}, {\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-426\", \"description\": \"CWE-426 Untrusted Search Path\"}]}], \"providerMetadata\": {\"orgId\": \"9b29abf9-4ab0-4765-b253-1875cd9b441e\", \"shortName\": \"CPANSec\", \"dateUpdated\": \"2025-09-05T13:24:00.827Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2025-40909\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-11-03T18:09:27.894Z\", \"dateReserved\": \"2025-04-16T09:05:34.360Z\", \"assignerOrgId\": \"9b29abf9-4ab0-4765-b253-1875cd9b441e\", \"datePublished\": \"2025-05-30T12:20:11.237Z\", \"assignerShortName\": \"CPANSec\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…