MODERATE 5.9

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-json
  • org.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-jawn
  • io.circe :: circe-parser
  • org.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:

Blast radius

1affected artifacts
25affected versions
3,913dependent artifacts (est.)
171,476dependent versions

89% of the dependent artifacts (3,513) still pull an affected version in their latest release.

DepthDependent 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

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.