CVE-2026-32948
sbt: Source dependency feature (via crafted VCS URL) leads to arbitrary code execution on Windows
Description
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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.scala-sbt » sbt | >= 0.9.5, < 1.12.8 | 1.12.8 |
Blast radius
58% of the dependent artifacts (18) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 422 |
| 2 hops | 185 |
Most used dependents
- org.scala-sbt » scripted-plugin6 usages
- org.scala-sbt » scripted-sbt4 usages
- org.scala-sbt » scripted-sbt-redux3 usages
- org.scala-sbt » sbt-dependency-tree_2.12_1.03 usages
- net.scalax.djx314 » sbt-depts-djx314-plugins2 usages
- com.47deg » org-policies-core1 usages
- io.github.swoogles » sbt-codeartifact-core1 usages
- org.scalameta » mdoc-docs0 usages
- org.openurp » sbt-openurp-parent_2.12_1.00 usages
- au.com.dius » pact-jvm-consumer-sbt_2.10_0.130 usages
- au.com.dius » pact-jvm-provider-sbt_2.10_0.130 usages
- org.bitbucket.pshirshov.sbt » pblib0 usages
- io.h8.sbt » sbt-scoverage-summary_2.12_1.00 usages
- io.7mind.izumi.sbt » sbt-izumi_2.12_1.00 usages
- net.scalax.djx314 » sbt-depts-djx314_2.12_1.00 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2026-32948 | nvd.nist.gov |
| Package | sbt/sbt | github.com |
| Web | sbt/sbt advisory GHSA-x4ff-q6h8-v7gw | github.com |
| Web | sbt/sbt commit 1ce945b | github.com |
| Web | sbt/sbt commit 3a474ab | github.com |
| Web | sbt/sbt release v1.12.7 | github.com |
