CVSS Vector
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Lifecycle Timeline
4Description
### Summary On Windows, sbt uses `Process("cmd", "/c", ...)` to run VCS commands (git, hg, svn). The URI fragment (branch, tag, revision) is user-controlled via the build definition and passed to these commands without validation. Because `cmd /c` interprets `&`, `|`, and `;` as command separators, a malicious fragment can execute arbitrary commands. ### Details - [Resolvers.scala L84-95](https://github.com/sbt/sbt/blob/dc90f160dfb563f46fd1a7b97945c381d15e2a6c/main/src/main/scala/sbt/Resolvers.scala#L84-L95) - git resolver passes `uri.getFragment()` to `run()` without sanitization - [Resolvers.scala L137-145](https://github.com/sbt/sbt/blob/dc90f160dfb563f46fd1a7b97945c381d15e2a6c/main/src/main/scala/sbt/Resolvers.scala#L137-L145) - `run()` uses `Process("cmd", "/c", ...)` on Windows, so `cmd` interprets `&&` as command separator ### PoC ```sh # build.properties # sbt.version=1.12.5 # Tested on those two versions of sbt sbt.version=2.0.0-RC9 ``` ```scala // build.sbt ThisBuild / scalaVersion := "2.12.19" lazy val root = project .in(file(".")) .dependsOn(vulnerable) lazy val vulnerable = RootProject( uri("https://github.com/sbt/io.git#develop%26%26calc.exe") ) ``` ### Impact Windows users are impacted. An attacker can execute arbitrary Windows commands if they control the dependency URI.
Analysis
sbt on Windows is vulnerable to command injection through unvalidated URI fragments in VCS dependency declarations. When resolving git, mercurial, or subversion repositories, sbt passes user-controlled branch, tag, or revision parameters directly to cmd.exe without sanitization, allowing attackers to inject arbitrary Windows commands via special characters like &, |, and ; that cmd /c interprets as command separators. …
Sign in for full analysis, threat intelligence, and remediation guidance.
Remediation
Within 30 days: Identify affected systems and apply vendor patches as part of regular patch cycle. Validate input sanitization for user-controlled parameters.
Sign in for detailed remediation steps.
Priority Score
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-14990
GHSA-x4ff-q6h8-v7gw