CVE-2022-21653
Hash collision in typelevel jawn
Description
Impact
Extenders of the org.typelevel.jawn.SimpleFacade and org.typelevel.jawn.MutableFacade who don't override objectContext() are vulnerable to a hash collision attack. Most applications do not implement these traits directly, but inherit from a library:
Affected implementations include:
org.http4s::http4s-play-jsonorg.typelevel :: jawn-ast(< 0.8.0)org.typelevel :: jawn-play(discontinued)org.typelevel :: jawn-rojoma(discontinued)org.typelevel :: jawn-spray(discontinued)
Unaffected implementations include:
io.argonaut :: argonaut-jawnio.circe :: circe-parserorg.typelevel :: jawn-ast(>= 0.8.0)org.typelevel :: jawn-json4s(discontinued)org.typelevel :: jawn-argonaut(discontinued)
Patches
jawn-parser-1.3.2 fixes the issue.
Workarounds
Override objectContext() to use a collision-safe collection. See the patch for an example in both SimpleFacade and MutableFacade.
References
- https://github.com/typelevel/jawn/pull/390
Credits
- @kag0, for the report and the patch
For more information
If you have any questions or comments about this advisory:
- Open an issue in typelevel/jawn
- E-mail a maintainer:
Affected Maven artifacts (18)
Blast radius
89% of the dependent artifacts (3,513) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 1,625 |
| 2 hops | 11,809 |
| 3 hops | 59,648 |
| 4 hops | 57,681 |
| 5 hops | 29,907 |
| 6 hops | 10,806 |
Most used dependents
- net.alchim31.maven » scala-maven-plugin3,328 usages
- com.typesafe.play » play-test1,902 usages
- io.circe » circe-parser1,656 usages
- com.typesafe.play » play-server1,436 usages
- com.typesafe.play » play-logback1,380 usages
- org.scalatestplus.play » scalatestplus-play1,286 usages
- org.scala-sbt » sbt1,240 usages
- com.typesafe.play » play-akka-http-server1,152 usages
- com.typesafe.play » filters-helpers1,129 usages
- com.typesafe.play » play-json1,088 usages
- com.typesafe.play » play1,025 usages
- com.typesafe.play » play-ws755 usages
- com.typesafe.play » play-ahc-ws693 usages
- com.typesafe.play » play-netty-server627 usages
- org.http4s » http4s-circe344 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
