CVE-2025-61659: CWE-377 Insecure Temporary File in magicmonty bash-git-prompt
bash-git-prompt 2.6.1 through 2.7.1 insecurely uses the /tmp/git-index-private$$ file, which has a predictable name.
AI Analysis
Technical Summary
CVE-2025-61659 identifies a security vulnerability in the bash-git-prompt project, specifically versions 2.6.1 through 2.7.1. The issue arises from the insecure creation and use of a temporary file named /tmp/git-index-private$$, where the '$$' represents the process ID, making the filename predictable. This predictable naming convention allows local attackers to anticipate the file's location and potentially perform malicious actions such as symlink attacks, file replacement, or unauthorized data access. The vulnerability is classified under CWE-377, which concerns the insecure handling of temporary files. Exploiting this flaw could lead to partial compromise of confidentiality, integrity, and availability of the affected system or user data. The attack vector is local (AV:L), requiring the attacker to have access to the system but no special privileges (PR:N) or user interaction (UI:N). The vulnerability has a scope change (S:C), meaning the impact extends beyond the vulnerable component. The CVSS v3.1 base score is 6.8, indicating medium severity. No public exploits are currently known, but the predictable temporary file usage is a common and well-understood attack vector. The vulnerability affects environments where bash-git-prompt is used, typically in developer shells or CI pipelines on Unix-like systems. Since the vulnerability involves temporary file handling in /tmp, it can be exploited by any local user with access to the filesystem namespace, potentially allowing privilege escalation or data tampering. The lack of patches at the time of publication suggests that users should implement workarounds or monitor for updates from the vendor.
Potential Impact
For European organizations, the impact of CVE-2025-61659 can be significant in environments where bash-git-prompt is used, particularly in software development, continuous integration, and deployment pipelines. Exploitation could allow local attackers to manipulate temporary files, leading to unauthorized access or modification of sensitive data, injection of malicious commands, or disruption of development workflows. This could result in data leaks, integrity violations in source code or build artifacts, and potential denial of service if critical scripts fail. Organizations relying on shared development environments or multi-user systems are at higher risk, as attackers with local access could leverage this vulnerability to escalate privileges or compromise other users' sessions. Although the attack requires local access, insider threats or compromised accounts could exploit this vulnerability. The medium severity rating reflects a moderate risk that should not be ignored, especially in high-security or regulated sectors prevalent in Europe such as finance, healthcare, and critical infrastructure. Failure to address this vulnerability could lead to compliance issues under GDPR or other data protection regulations if sensitive data is exposed or integrity is compromised.
Mitigation Recommendations
To mitigate CVE-2025-61659, European organizations should first update bash-git-prompt to a version that addresses the insecure temporary file usage once available. Until patches are released, users should avoid using vulnerable versions and consider disabling bash-git-prompt in multi-user or sensitive environments. Implement secure temporary file creation practices by using system calls or libraries that generate unpredictable temporary filenames (e.g., mkstemp) instead of predictable patterns. Restrict permissions on the /tmp directory to prevent unauthorized users from creating or modifying files. Employ mandatory access controls (e.g., AppArmor, SELinux) to limit the ability of local users to interfere with temporary files used by bash-git-prompt. Conduct regular audits of temporary file usage in scripts and development tools to identify similar insecure patterns. Educate developers and system administrators about the risks of predictable temporary files and enforce secure coding standards. Monitor system logs for suspicious file access or modification attempts in /tmp. Finally, isolate build and development environments to reduce the risk of local privilege escalation through such vulnerabilities.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Poland, Italy, Spain
CVE-2025-61659: CWE-377 Insecure Temporary File in magicmonty bash-git-prompt
Description
bash-git-prompt 2.6.1 through 2.7.1 insecurely uses the /tmp/git-index-private$$ file, which has a predictable name.
AI-Powered Analysis
Technical Analysis
CVE-2025-61659 identifies a security vulnerability in the bash-git-prompt project, specifically versions 2.6.1 through 2.7.1. The issue arises from the insecure creation and use of a temporary file named /tmp/git-index-private$$, where the '$$' represents the process ID, making the filename predictable. This predictable naming convention allows local attackers to anticipate the file's location and potentially perform malicious actions such as symlink attacks, file replacement, or unauthorized data access. The vulnerability is classified under CWE-377, which concerns the insecure handling of temporary files. Exploiting this flaw could lead to partial compromise of confidentiality, integrity, and availability of the affected system or user data. The attack vector is local (AV:L), requiring the attacker to have access to the system but no special privileges (PR:N) or user interaction (UI:N). The vulnerability has a scope change (S:C), meaning the impact extends beyond the vulnerable component. The CVSS v3.1 base score is 6.8, indicating medium severity. No public exploits are currently known, but the predictable temporary file usage is a common and well-understood attack vector. The vulnerability affects environments where bash-git-prompt is used, typically in developer shells or CI pipelines on Unix-like systems. Since the vulnerability involves temporary file handling in /tmp, it can be exploited by any local user with access to the filesystem namespace, potentially allowing privilege escalation or data tampering. The lack of patches at the time of publication suggests that users should implement workarounds or monitor for updates from the vendor.
Potential Impact
For European organizations, the impact of CVE-2025-61659 can be significant in environments where bash-git-prompt is used, particularly in software development, continuous integration, and deployment pipelines. Exploitation could allow local attackers to manipulate temporary files, leading to unauthorized access or modification of sensitive data, injection of malicious commands, or disruption of development workflows. This could result in data leaks, integrity violations in source code or build artifacts, and potential denial of service if critical scripts fail. Organizations relying on shared development environments or multi-user systems are at higher risk, as attackers with local access could leverage this vulnerability to escalate privileges or compromise other users' sessions. Although the attack requires local access, insider threats or compromised accounts could exploit this vulnerability. The medium severity rating reflects a moderate risk that should not be ignored, especially in high-security or regulated sectors prevalent in Europe such as finance, healthcare, and critical infrastructure. Failure to address this vulnerability could lead to compliance issues under GDPR or other data protection regulations if sensitive data is exposed or integrity is compromised.
Mitigation Recommendations
To mitigate CVE-2025-61659, European organizations should first update bash-git-prompt to a version that addresses the insecure temporary file usage once available. Until patches are released, users should avoid using vulnerable versions and consider disabling bash-git-prompt in multi-user or sensitive environments. Implement secure temporary file creation practices by using system calls or libraries that generate unpredictable temporary filenames (e.g., mkstemp) instead of predictable patterns. Restrict permissions on the /tmp directory to prevent unauthorized users from creating or modifying files. Employ mandatory access controls (e.g., AppArmor, SELinux) to limit the ability of local users to interfere with temporary files used by bash-git-prompt. Conduct regular audits of temporary file usage in scripts and development tools to identify similar insecure patterns. Educate developers and system administrators about the risks of predictable temporary files and enforce secure coding standards. Monitor system logs for suspicious file access or modification attempts in /tmp. Finally, isolate build and development environments to reduce the risk of local privilege escalation through such vulnerabilities.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- mitre
- Date Reserved
- 2025-09-29T00:00:00.000Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 68dab94e936545403921621c
Added to database: 9/29/2025, 4:52:30 PM
Last enriched: 10/15/2025, 4:16:48 PM
Last updated: 11/14/2025, 12:58:49 AM
Views: 127
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.
Related Threats
CVE-2025-64530: CWE-288: Authentication Bypass Using an Alternate Path or Channel in apollographql federation
HighCVE-2025-36251: CWE-114 Process Control in IBM AIX
CriticalCVE-2025-36250: CWE-114 Process Control in IBM AIX
CriticalCVE-2025-36236: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in IBM AIX
HighCVE-2025-36096: CWE-522 Insufficiently Protected Credentials in IBM AIX
CriticalActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.