CVE-2023-46122
LOW3.9EPSS 0.03%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 - https://github.com/snyk/zip-slip-vulnerability - https://security.snyk.io/vuln/SNYK-JAVA-ORGCODEHAUSPLEXUS-31680 - https://github.com/sbt/io/issues/358
受影響套件(4)
- Maven/org.scala-sbt:io_2.12>= 1.0.0, < 1.9.7
- Maven/org.scala-sbt:io_2.13>= 1.0.0, < 1.9.7
- Maven/org.scala-sbt:io_3>= 1.0.0, < 1.9.7
- Maven/org.scala-sbt:sbt>= 0.3.4, < 1.9.7
CVSS 分數
| 來源 | 版本 | 嚴重程度 | 向量 |
|---|---|---|---|
| osv | CVSS 3.1 | LOW3.9 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L |
參考連結(6)
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2023-46122
- PATCHhttps://github.com/sbt/sbt
- WEBhttps://github.com/sbt/io/commit/124538348db0713c80793cb57b915f97ec13188a
- WEBhttps://github.com/sbt/io/issues/358
- WEBhttps://github.com/sbt/io/pull/360
- WEBhttps://github.com/sbt/sbt/security/advisories/GHSA-h9mw-grgx-2fhf