CVE-2022-21653: Hash collision in typelevel jawn

org.typelevel:jawn-parser Updated 02 Oct 2025

Summary

06/01/2022
Yes i
Moderate
5.9

CVE-2022-21653: Hash collision in typelevel jawn. Affects org.typelevel:jawn-parser versions < 1.3.2. Fixed in 1.3.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The package under scrutiny is org.typelevel:jawn-parser, which is a JSON parser for Scala. It provides a set of traits, including org.typelevel.jawn.SimpleFacade and org.typelevel.jawn.MutableFacade, which can be extended to customize JSON parsing behavior. However, extenders who don't override objectContext() are vulnerable to a hash collision attack. This vulnerability affects various implementations inherited from the library, such as org.http4s::http4s-play-json, org.typelevel::jawn-ast (< 0.8.0), org.typelevel::jawn-play, org.typelevel::jawn-rojoma, and org.typelevel::jawn-spray. Unaffected implementations include io.argonaut::argonaut-jawn, io.circe::circe-parser, org.typelevel::jawn-ast (>= 0.8.0), org.typelevel::jawn-json4s, and org.typelevel::jawn-argonaut.

Vulnerability Detail

The vulnerability arises from a hash collision attack on the objectContext() method in the affected implementations. Extenders who don't override this method are susceptible to the attack. The impact of this vulnerability is moderate, as it allows an attacker to exploit hash collisions to cause denial of service (DoS) by consuming excessive CPU resources. The vulnerability has been assigned a CVSS score of 5.9.

How To Fix

Minimum fixed version

1.3.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the library is not immediately feasible, a workaround is to override the objectContext() method in the affected implementations to use a collision-safe collection. The patch provided in the GitHub pull request (https://github.com/typelevel/jawn/pull/390/files) offers an example of how to implement this workaround in both SimpleFacade and MutableFacade.

Conclusion

In conclusion, the org.typelevel:jawn-parser package is vulnerable to a hash collision attack in certain implementations. It is crucial to update the library to version 1.3.2 or apply the provided workaround to mitigate the risk of denial of service attacks. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.typelevel:jawn-parser →

Share this vulnerability

FAQ

The vulnerability affects implementations inherited from the jawn-parser library, including org.http4s::http4s-play-json, org.typelevel::jawn-ast (< 0.8.0), org.typelevel::jawn-play, org.typelevel::jawn-rojoma, and org.typelevel::jawn-spray.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities using just the pom.xml file.

The vulnerability allows an attacker to exploit hash collisions to cause denial of service (DoS) by consuming excessive CPU resources. However, it does not enable remote code execution or unauthorized access to sensitive information.

Yes, a workaround is to override the objectContext() method in the affected implementations to use a collision-safe collection. The provided patch in the GitHub pull request (https://github.com/typelevel/jawn/pull/390/files) demonstrates how to implement this workaround.

Yes, the vulnerability can be fixed by updating the jawn-parser library to version 1.3.2, which includes the necessary patches to address the issue.

How To Fix

Minimum fixed version

1.3.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback