CVE-2025-67640
Java vulnerability analysis and mitigation

Overview

CVE-2025-67640 is an OS command injection vulnerability (SECURITY-3614) in the Jenkins Git client Plugin affecting versions 6.4.0 and earlier. The plugin generates temporary shell scripts (e.g., for SSH_ASKPASS credential handling) that embed the workspace directory path as an unescaped command argument, enabling attackers who can control the workspace directory name to inject arbitrary OS commands on Jenkins agents. It was disclosed on December 10, 2025, as part of the Jenkins Security Advisory 2025-12-10. The CVSS v3.1 base score is 5.0 (Medium) (Jenkins Advisory, GitHub Advisory).

Technical details

The root cause is improper neutralization of special elements in an OS command (CWE-78). When the Git client Plugin generates temporary shell scripts to supply credentials (e.g., via the SSH_ASKPASS mechanism), it interpolates the workspace directory path directly into a command argument without proper shell escaping. An attacker who can control the working directory name — for example, by supplying a crafted argument to the dir(…) Pipeline step — can embed shell metacharacters or commands in the directory name, which are then executed when the temporary script runs on the agent. Exploitation requires the attacker to control the working directory but not the Pipeline itself or the build scripts it executes, making this a constrained but realistic attack path in multi-tenant or shared Jenkins environments. The fix in version 6.4.1 passes the workspace path as an environment variable rather than a command argument, eliminating the injection vector (Jenkins Advisory, GitHub Advisory).

Impact

Successful exploitation allows a low-privileged authenticated attacker to execute arbitrary OS commands on Jenkins agent nodes where the vulnerable plugin is active. This can result in confidentiality loss (access to secrets, credentials, source code on the agent), integrity compromise (modification of build artifacts or scripts), and limited availability impact. The scope is confined to the agent system rather than the Jenkins controller, but agents often have access to sensitive credentials, deployment keys, and internal network resources that could facilitate lateral movement (Jenkins Advisory, GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify Jenkins instances using Git client Plugin version 6.4.0 or earlier, particularly those with Pipeline jobs that allow user-controlled dir(…) step arguments or workspace directory names.
  2. Obtain low-privileged access: Authenticate to the Jenkins instance with any valid user account that has permission to configure or trigger Pipeline jobs.
  3. Craft a malicious workspace directory name: Create a directory name containing shell metacharacters or injected commands, such as workspace$(malicious_command) or workspace; malicious_command #.
  4. Trigger the vulnerable code path: Configure or trigger a Pipeline job that uses the dir(…) step with the crafted directory name, causing the Git client Plugin to generate a temporary shell script (e.g., for SSH_ASKPASS) that embeds the unescaped path.
  5. Achieve command execution on the agent: When the temporary script is executed on the Jenkins agent, the injected OS commands run in the agent's security context, potentially enabling credential theft, reverse shell establishment, or further lateral movement (Jenkins Advisory).

Indicators of compromise

  • Logs: Jenkins build logs showing unexpected command output or errors originating from temporary SSH_ASKPASS or credential helper scripts; agent logs with unusual process execution traces tied to Git operations.
  • File System: Presence of temporary shell scripts in the agent workspace directory with anomalous content (e.g., embedded shell commands beyond expected credential-passing logic); unexpected files created by the agent process (e.g., reverse shell scripts, exfiltration tools).
  • Process: Unusual child processes spawned by the Jenkins agent JVM or shell scripts during Git credential operations (e.g., curl, wget, nc, bash -i, or other network tools not expected in normal build activity).
  • Network: Unexpected outbound connections from Jenkins agent nodes to external IPs, particularly during or shortly after Git clone/fetch operations that use SSH credentials.

Mitigation and workarounds

The primary remediation is to upgrade the Jenkins Git client Plugin to version 6.4.1 or later, which passes the workspace directory path as an environment variable instead of a command argument, eliminating the injection vector. No configuration-based workaround is available; upgrading is the only supported fix. Organizations should also review Pipeline job configurations to restrict who can control the dir(…) step argument or workspace directory names as a defense-in-depth measure (Jenkins Advisory, GitHub Advisory).

Community reactions

The vulnerability was disclosed as part of the broader Jenkins Security Advisory 2025-12-10, which also covered high-severity issues such as a DoS in the HTTP-based CLI and a stored XSS in the Coverage Plugin. Security news outlets noted the advisory's scope, with coverage highlighting the higher-severity issues alongside CVE-2025-67640. No notable individual researcher commentary or significant social media discussion specific to this CVE has been identified (Security Online).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-p279-2cqp-84jgCRITICAL9.6
  • Java logoJava
  • org.openidentityplatform.opendj:opendj-server-legacy
NoYesJul 24, 2026
GHSA-fp43-vj7g-pg92HIGH7.5
  • Java logoJava
  • org.omnifaces:omnifaces
NoYesJul 24, 2026
GHSA-7ppr-r889-mcf2HIGH7.5
  • Java logoJava
  • org.http4s:http4s-blaze-server_2.12
NoYesJul 24, 2026
GHSA-mhvj-jhpq-885vHIGH7.4
  • Java logoJava
  • org.http4s:http4s-blaze-server_2.13
NoYesJul 24, 2026
GHSA-46q4-43ph-c6frHIGH7.4
  • Java logoJava
  • org.http4s:blaze-http_2.12
NoYesJul 24, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management