6.7medium
sbt: Source dependency feature (via crafted VCS URL) leads to arbitrary code execution on Windows
- Severity
- 6.7medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.35% (higher than 30% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-x4ff-q6h8-v7gw
Description
sbt is a build tool for Scala, Java, and others. From version 0.9.5 to before version 1.12.7, 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. This issue has been patched in version 1.12.7.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| sbt sbt | >= 0.9.5, < 1.12.7 | CVE List |
| org.scala-sbt:sbt (Maven) | from 0.9.5 before 1.12.8 | GitHub Advisory Database |
| scala.epfl sbt | from 0.9.5 before 1.12.7 | NVD |
All scores
| GitHub_M | 6.7medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
sbt is a build tool for Scala, Java, and others. From version 0.9.5 to before version 1.12.7, 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. This issue has been patched in version 1.12.7.
GitHub Advisory Database
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.
Patched version
Technically, sbt 1.12.7 is patched, but it has a bug that makes source dependency non-functional, so update to sbt 1.12.8 or later instead.
Details
- Resolvers.scala L84–95 — git resolver passes
uri.getFragment()torun()without sanitization - Resolvers.scala L137–145 —
run()usesProcess("cmd", "/c", ...)on Windows, socmdinterprets&&as command separator
PoC
# build.properties
# sbt.version=1.12.5 # Tested on those two versions of sbt
sbt.version=2.0.0-RC9
// 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.
NVD (es)
sbt es una herramienta de construcción para Scala, Java y otros. Desde la versión 0.9.5 hasta antes de la versión 1.12.7, en Windows, sbt utiliza Process(cmd, /c, ...) para ejecutar comandos VCS (git, hg, svn). El fragmento URI (rama, etiqueta, revisión) es controlado por el usuario a través de la definición de construcción y se pasa a estos comandos sin validación. Debido a que cmd /c interpreta &, |, y ; como separadores de comandos, un fragmento malicioso puede ejecutar comandos arbitrarios. Este problema ha sido parcheado en la versión 1.12.7.
References
| https://github.com/sbt/sbt/security/advisories/GHSA-x4ff-q6h8-v7gw | exploit, vendor-advisory, web | |
| https://github.com/sbt/sbt/commit/1ce945b6b79cbe3cef6c0fe9efbbd2904e0f479e | patch, web | |
| https://github.com/sbt/sbt/commit/3a474ab060df4dbfa825a7e7bc97e00056519800 | patch, web | |
| https://github.com/sbt/sbt/releases/tag/v1.12.7 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-32948 | advisory | |
| https://github.com/sbt/sbt | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32948 changed 2026-03-26 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-x4ff-q6h8-v7gw changed 2026-03-27 | CC-BY-4.0 |
| NVD | CVE-2026-32948 changed 2026-06-17 | Public domain |