Skip to content

Hash collision in typelevel jawn

Moderate severity GitHub Reviewed Published Jan 5, 2022 in typelevel/jawn • Updated Feb 3, 2023

Package

maven org.typelevel:jawn-parser (Maven)

Affected versions

< 1.3.2

Patched versions

1.3.2

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

Credits

  • @kag0, for the report and the patch

For more information

If you have any questions or comments about this advisory:

References

@rossabaker rossabaker published to typelevel/jawn Jan 5, 2022
Published by the National Vulnerability Database Jan 5, 2022
Reviewed Jan 6, 2022
Published to the GitHub Advisory Database Jan 6, 2022
Last updated Feb 3, 2023

Severity

Moderate
5.9
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2022-21653

GHSA ID

GHSA-vc89-hccf-rq55

Source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.