2025-10-31 16:41CVE-2025-6075PSF
PUBLISHED5.2

Quadratic complexity in os.path.expandvars() with user-controlled template

If the value passed to os.path.expandvars() is user-controlled a

performance degradation is possible when expanding environment

variables.

Affected products

Python Software Foundation

CPython

< 3.15.0 - AFFECTED

References

GitHub Security Advisories

GHSA-vc2m-m665-8xm2

If the value passed to os.path.expandvars() is user-controlled a performance degradation is...

https://github.com/advisories/GHSA-vc2m-m665-8xm2

If the value passed to os.path.expandvars() is user-controlled a performance degradation is possible when expanding environment variables.

JSON source

Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2025-6075",
    "assignerOrgId": "28c92f92-d60d-412d-b760-e73465c3df22",
    "assignerShortName": "PSF",
    "dateUpdated": "2025-10-31T17:55:40.240Z",
    "dateReserved": "2025-06-13T15:05:20.139Z",
    "datePublished": "2025-10-31T16:41:34.983Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "28c92f92-d60d-412d-b760-e73465c3df22",
        "shortName": "PSF",
        "dateUpdated": "2025-10-31T17:12:40.996Z"
      },
      "title": "Quadratic complexity in os.path.expandvars() with user-controlled template",
      "descriptions": [
        {
          "lang": "en",
          "value": "If the value passed to os.path.expandvars() is user-controlled a \nperformance degradation is possible when expanding environment \nvariables.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "<div>If the value passed to os.path.expandvars() is user-controlled a \nperformance degradation is possible when expanding environment \nvariables.</div>"
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "Python Software Foundation",
          "product": "CPython",
          "repo": "https://github.com/python/cpython",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "python",
              "lessThan": "3.15.0"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/python/cpython/issues/136065",
          "tags": [
            "issue-tracking"
          ]
        },
        {
          "url": "https://mail.python.org/archives/list/security-announce@python.org/thread/IUP5QJ6D4KK6ULHOMPC7DPNKRYQTQNLA/",
          "tags": [
            "vendor-advisory"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/2e6150adccaaf5bd95d4c19dfd04a36e0b325d8c",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/631ba3407e3348ccd56ce5160c4fb2c5dc5f4d84",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/892747b4cf0f95ba8beb51c0d0658bfaa381ebca",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/9ab89c026aa9611c4b0b67c288b8303a480fe742",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/c8a5f3435c342964e0a432cc9fb448b7dbecd1ba",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/f029e8db626ddc6e3a3beea4eff511a71aaceb5c",
          "tags": [
            "patch"
          ]
        }
      ],
      "metrics": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ]
    },
    "adp": [
      {
        "providerMetadata": {
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP",
          "dateUpdated": "2025-10-31T17:55:40.240Z"
        },
        "title": "CISA ADP Vulnrichment",
        "problemTypes": [
          {
            "descriptions": [
              {
                "lang": "en",
                "description": "CWE-400 Uncontrolled Resource Consumption",
                "cweId": "CWE-400",
                "type": "CWE"
              }
            ]
          }
        ],
        "metrics": [
          {}
        ]
      }
    ]
  }
}

Mitre source

https://cveawg.mitre.org/api/cve/CVE-2025-6075