Executive brief
The Jenkins Git client plugin, which manages Git operations for automation workflows, contains a security flaw in how it handles workspace folder names. If an attacker can influence the name of a build's working directory, they can trick the system into running unauthorized commands on the underlying server (agent). This could lead to a full compromise of the build environment and unauthorized access to sensitive data or internal systems.
Technical details
An OS command injection vulnerability exists in the Jenkins Git client Plugin (version 6.6.0 and earlier) within the 'Manually provided keys' Git Host Key Verification strategy. The plugin fails to correctly escape the workspace directory name when embedding it into a generated SSH wrapper script on Unix-based agents. An attacker who can control the name of a build's working directory (for example, via a build parameter used in a 'dir(...)' Pipeline step) can inject shell command substitutions. This allows for arbitrary command execution on the Jenkins agent. The vulnerability is mitigated if the attacker cannot control the workspace name or the Pipeline script itself. The fix in version 6.6.1 moves the known_hosts file to a system temporary directory, removing the workspace path from the SSH wrapper script.
Affected products
- Jenkins Project Git client Plugin 6.6.0 and earlier
Timeline
- 2026-06-24: disclosed
- 2026-06-24: advisory
- 2026-06-24: patched: Fixed in version 6.6.1