CVE-2026-32948
JSON

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 packageVersionsReported by
sbt sbt>= 0.9.5, < 1.12.7CVE List
org.scala-sbt:sbt (Maven)from 0.9.5 before 1.12.8GitHub Advisory Database
scala.epfl sbtfrom 0.9.5 before 1.12.7NVD

All scores

GitHub_M6.7medium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-78

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
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 &amp;, |, 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

Sources

SourceRecordLicence
CVE ListCVE-2026-32948 changed 2026-03-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-x4ff-q6h8-v7gw changed 2026-03-27CC-BY-4.0
NVDCVE-2026-32948 changed 2026-06-17Public domain