CVE-2025-6075: Vulnerability in Python Software Foundation CPython
If the value passed to os.path.expandvars() is user-controlled a performance degradation is possible when expanding environment variables.
AI Analysis
Technical Summary
CVE-2025-6075 identifies a vulnerability in the CPython implementation maintained by the Python Software Foundation, specifically affecting the os.path.expandvars() function. This function expands environment variables within a given string, but when the input is user-controlled, it can lead to performance degradation due to excessive or inefficient processing of environment variable expansions. The root cause aligns with CWE-400, indicating uncontrolled resource consumption, which can manifest as a denial-of-service condition through CPU or memory exhaustion. The vulnerability affects a wide range of CPython versions, from the initial release (0) through 3.15.0a1, highlighting a longstanding issue. Exploitation requires local access with high privileges (PR:H) and does not require user interaction (UI:N). The CVSS 4.0 score of 1.8 reflects the low severity, considering the limited impact and exploitation complexity. No known exploits have been reported in the wild, and no official patches have been linked at the time of publication. The vulnerability does not compromise confidentiality, integrity, or availability directly but may degrade system performance if an attacker repeatedly invokes expandvars() with crafted input. This could be leveraged in scenarios where untrusted input is passed to this function, potentially impacting resource availability on affected systems.
Potential Impact
The primary impact of CVE-2025-6075 is performance degradation due to resource exhaustion when os.path.expandvars() processes user-controlled input. While it does not directly compromise data confidentiality or integrity, the vulnerability can lead to denial-of-service conditions by consuming excessive CPU or memory resources. This can affect applications or systems relying on CPython where environment variable expansion is performed on untrusted input, potentially causing slowdowns or crashes. Organizations with critical Python-based infrastructure or development environments may experience reduced availability or degraded performance, impacting operational efficiency. Since exploitation requires local high-privilege access, the risk is mitigated in many environments but remains relevant in multi-user or shared systems where privilege escalation is possible. The lack of known exploits reduces immediate risk, but unpatched systems remain vulnerable to targeted attacks aiming to degrade service.
Mitigation Recommendations
To mitigate CVE-2025-6075, organizations should avoid passing untrusted or user-controlled input directly to os.path.expandvars(). Input validation and sanitization should be implemented to restrict or sanitize environment variable expansions. Monitoring and limiting the frequency of calls to expandvars() in sensitive or high-privilege contexts can reduce the risk of resource exhaustion. Applying the principle of least privilege to limit who can execute code that invokes expandvars() is critical. Organizations should track updates from the Python Software Foundation and apply patches promptly once available. Additionally, employing resource usage monitoring and alerting can help detect abnormal CPU or memory consumption patterns indicative of exploitation attempts. In environments where local access is shared, enforcing strict access controls and auditing can prevent unauthorized exploitation. Finally, consider using alternative methods for environment variable expansion that are less susceptible to performance degradation when handling untrusted input.
Affected Countries
United States, Germany, India, China, Japan, United Kingdom, France, Canada, Australia, South Korea
CVE-2025-6075: Vulnerability in Python Software Foundation CPython
Description
If the value passed to os.path.expandvars() is user-controlled a performance degradation is possible when expanding environment variables.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-6075 identifies a vulnerability in the CPython implementation maintained by the Python Software Foundation, specifically affecting the os.path.expandvars() function. This function expands environment variables within a given string, but when the input is user-controlled, it can lead to performance degradation due to excessive or inefficient processing of environment variable expansions. The root cause aligns with CWE-400, indicating uncontrolled resource consumption, which can manifest as a denial-of-service condition through CPU or memory exhaustion. The vulnerability affects a wide range of CPython versions, from the initial release (0) through 3.15.0a1, highlighting a longstanding issue. Exploitation requires local access with high privileges (PR:H) and does not require user interaction (UI:N). The CVSS 4.0 score of 1.8 reflects the low severity, considering the limited impact and exploitation complexity. No known exploits have been reported in the wild, and no official patches have been linked at the time of publication. The vulnerability does not compromise confidentiality, integrity, or availability directly but may degrade system performance if an attacker repeatedly invokes expandvars() with crafted input. This could be leveraged in scenarios where untrusted input is passed to this function, potentially impacting resource availability on affected systems.
Potential Impact
The primary impact of CVE-2025-6075 is performance degradation due to resource exhaustion when os.path.expandvars() processes user-controlled input. While it does not directly compromise data confidentiality or integrity, the vulnerability can lead to denial-of-service conditions by consuming excessive CPU or memory resources. This can affect applications or systems relying on CPython where environment variable expansion is performed on untrusted input, potentially causing slowdowns or crashes. Organizations with critical Python-based infrastructure or development environments may experience reduced availability or degraded performance, impacting operational efficiency. Since exploitation requires local high-privilege access, the risk is mitigated in many environments but remains relevant in multi-user or shared systems where privilege escalation is possible. The lack of known exploits reduces immediate risk, but unpatched systems remain vulnerable to targeted attacks aiming to degrade service.
Mitigation Recommendations
To mitigate CVE-2025-6075, organizations should avoid passing untrusted or user-controlled input directly to os.path.expandvars(). Input validation and sanitization should be implemented to restrict or sanitize environment variable expansions. Monitoring and limiting the frequency of calls to expandvars() in sensitive or high-privilege contexts can reduce the risk of resource exhaustion. Applying the principle of least privilege to limit who can execute code that invokes expandvars() is critical. Organizations should track updates from the Python Software Foundation and apply patches promptly once available. Additionally, employing resource usage monitoring and alerting can help detect abnormal CPU or memory consumption patterns indicative of exploitation attempts. In environments where local access is shared, enforcing strict access controls and auditing can prevent unauthorized exploitation. Finally, consider using alternative methods for environment variable expansion that are less susceptible to performance degradation when handling untrusted input.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PSF
- Date Reserved
- 2025-06-13T15:05:20.139Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6904e98dae52ebddb37144c0
Added to database: 10/31/2025, 4:53:33 PM
Last enriched: 3/3/2026, 6:32:53 PM
Last updated: 3/25/2026, 4:11:39 AM
Views: 375
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.