CVE-2026-32948: sbt: Source dependency feature (via crafted VCS URL) leads to arbitrary code execution on Windows
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 — git resolver passes uri.getFragment() to run() without sanitization - Resolvers.scala L137–145 — 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.
Other sources
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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.scala-sbt:sbtto a version that resolves this vulnerability.Fixed in 1.12.7 - Upgrade
Upgrade
sbt/sbtto a version that resolves this vulnerability.Fixed in 1.12.7
Event History
Frequently Asked Questions
What is the severity of CVE-2026-32948?
CVE-2026-32948 is classified as a high severity vulnerability due to its potential for command injection.
How do I fix CVE-2026-32948?
To fix CVE-2026-32948, upgrade to sbt version 1.12.8 or later which addresses the vulnerability.
What are the affected versions for CVE-2026-32948?
CVE-2026-32948 affects sbt versions between 0.9.5 and 1.12.7.
What types of software are vulnerable to CVE-2026-32948?
CVE-2026-32948 impacts the sbt build tool used for Scala projects on Windows.
What is the exploitation impact of CVE-2026-32948?
Exploitation of CVE-2026-32948 could allow an attacker to execute arbitrary commands on the affected system.