sbt vulnerable to arbitrary file write via archive extraction (Zip Slip)
Impact
Given specially crafted zip or JAR file, IO.unzip allows writing of arbitrary file. The follow is an example of a malicious entry:
+2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
This would have a 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 - https://github.com/search?q=IO.unzip+language%3AScala&type=code&l=Scala&p=1
Patches
The problem has been patched in https://github.com/sbt/io/pull/360 sbt 1.9.7 is available with the fix.
Workarounds
A workaround might be use some other library to unzip.
References
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.scala-sbt:io_2.12 | >= 1.0.0, < 1.9.7 | 1.9.7 |
| Java / Kotlin (Maven) | org.scala-sbt:io_2.13 | >= 1.0.0, < 1.9.7 | 1.9.7 |
| Java / Kotlin (Maven) | org.scala-sbt:io_3 | >= 1.0.0, < 1.9.7 | 1.9.7 |
| Java / Kotlin (Maven) | org.scala-sbt:sbt | >= 0.3.4, < 1.9.7 | 1.9.7 |
Verweise
- CVSS-Vektor
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L- Schwäche (CWE)
CWE-22- Plattform
- Java / Kotlin (Maven)
- Paket
org.scala-sbt:io_2.12, org.scala-sbt:io_2.13, org.scala-sbt:io_3- Veröffentlicht
- 24.10.2023
- Aktualisiert
- 11.10.2026 11:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-h9mw-grgx-2fhf - CC BY 4.0
Schwachstellenhistorie: org.scala-sbt:io_2.12
Alle veröffentlichten Schwachstellen dieses Pakets (Java / Kotlin (Maven)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
Dies ist die einzige bekannte Schwachstelle dieses Pakets.
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.