CVE-2023-46122 Arbitrary file write via archive extraction (Zip Slip) vulnerability in sbt
Attackers can write arbitrary files via crafted archives in sbt, potentially overwriting SSH keys to gain unauthorized access.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2023-46122?
CVE-2023-46122 is a low-severity path traversal vulnerability in sbt, published on 23 Oct 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-22
Which versions are affected by CVE-2023-46122?
8 open source packages ship an affected version, including org.scala-sbt:io_2.12, org.scala-sbt:io_2.13 and org.scala-sbt:io_3. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
org.scala-sbt:io_2.12 Maven | From 1.0.0 | 1.9.7 |
org.scala-sbt:io_2.12 Maven | From 1.0.0 | 1.9.7 |
org.scala-sbt:io_2.13 Maven | From 1.0.0 | 1.9.7 |
org.scala-sbt:io_2.13 Maven | From 1.0.0 | 1.9.7 |
org.scala-sbt:io_3 Maven | From 1.0.0 | 1.9.7 |
org.scala-sbt:io_3 Maven | From 1.0.0 | 1.9.7 |
2 more packages
org.scala-sbt:sbt Maven | From 0.3.4 | 1.9.7 |
org.scala-sbt:sbt Maven | From 0.3.4 | 1.9.7 |
Linux distribution packages (32)
maven SUSE:Enterprise Storage 7.1 | All versions | 3.9.4-150200.4.18.1 |
maven-resolver SUSE:Enterprise Storage 7.1 | All versions | 1.9.15-150200.3.14.2 |
xmvn SUSE:Enterprise Storage 7.1 | All versions | 4.2.0-150200.3.14.1 |
xmvn-connector SUSE:Enterprise Storage 7.1 | All versions | 4.2.0-150200.3.14.1 |
xmvn-mojo SUSE:Enterprise Storage 7.1 | All versions | 4.2.0-150200.3.14.1 |
xmvn-tools SUSE:Enterprise Storage 7.1 | All versions | 4.2.0-150200.3.14.1 |
maven SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 3.9.4-150200.4.18.1 |
maven-resolver SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.9.15-150200.3.14.2 |
xmvn SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 4.2.0-150200.3.14.1 |
xmvn-connector SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 4.2.0-150200.3.14.1 |
xmvn-mojo SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 4.2.0-150200.3.14.1 |
xmvn-tools SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 4.2.0-150200.3.14.1 |
maven SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 3.9.4-150200.4.18.1 |
maven-resolver SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 1.9.15-150200.3.14.2 |
xmvn SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 4.2.0-150200.3.14.1 |
xmvn-connector SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 4.2.0-150200.3.14.1 |
xmvn-mojo SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 4.2.0-150200.3.14.1 |
xmvn-tools SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 4.2.0-150200.3.14.1 |
maven SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 3.9.4-150200.4.18.1 |
maven-resolver SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.9.15-150200.3.14.2 |
xmvn SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 4.2.0-150200.3.14.1 |
xmvn-connector SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 4.2.0-150200.3.14.1 |
xmvn-mojo SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 4.2.0-150200.3.14.1 |
xmvn-tools SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 4.2.0-150200.3.14.1 |
maven SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 3.9.4-150200.4.18.1 |
maven-resolver SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 1.9.15-150200.3.14.2 |
xmvn SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 4.2.0-150200.3.14.1 |
xmvn-connector SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 4.2.0-150200.3.14.1 |
xmvn-mojo SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 4.2.0-150200.3.14.1 |
xmvn-tools SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 4.2.0-150200.3.14.1 |
maven SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 3.9.4-150200.4.18.1 |
maven-resolver SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 1.9.15-150200.3.14.2 |
Products include Scala-Sbt Io, Scala-Sbt Sbt.
How do I fix CVE-2023-46122?
Upgrade org.scala-sbt:io_2.12 to 1.9.7 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2023-46122 being exploited?
There is no known exploitation of CVE-2023-46122 in the wild and no public exploit code.
Sources
Also known as GHSA-h9mw-grgx-2fhf, OESA-2024-2422, SUSE-SU-2023:4527-1.