Arbitrary file write via archive extraction (Zip Slip) vulnerability in sbt
sbt
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| org.scala-sbt:sbt Maven |
|
|
| org.scala-sbt:io_2.12 Maven |
|
|
| org.scala-sbt:io_2.13 Maven |
sbt
| Product | Affected | Fixed in |
|---|---|---|
| org.scala-sbt:sbt Maven |
|
|
| org.scala-sbt:io_2.12 Maven |
|
|
| org.scala-sbt:io_2.13 Maven |
|
|
| org.scala-sbt:io_3 Maven |
|
|
sbt is a build tool for Scala, Java, and others. Given a specially crafted zip or JAR file, `IO.unzip` allows writing of arbitrary file. This would have potential to overwrite `/root/.ssh/authorized_keys`. Within sbt's main code, `IO.unzip` is used in `pullRemoteCache` task and `Resolvers.remote`; however many projects use `IO.unzip(...)` directly to implement custom tasks. This vulnerability has been patched in version 1.9.7.
From the CVE record · GitHub_M
sbt's IO.unzip can write files to arbitrary locations when it processes a specially crafted ZIP or JAR file. This could overwrite files such as /root/.ssh/authorized_keys; IO.unzip is used by sbt tasks and directly by some projects' custom tasks.
Check installations using Maven org.scala-sbt:sbt versions >=0.3.4 and <1.9.7, or org.scala-sbt:io_2.12, io_2.13, or io_3 versions >=1.0.0 and <1.9.7.