CVE-2022-21653: CWE-400: Uncontrolled Resource Consumption in typelevel jawn
Jawn is an open source JSON parser. Extenders of the `org.typelevel.jawn.SimpleFacade` and `org.typelevel.jawn.MutableFacade` who don't override `objectContext()` are vulnerable to a hash collision attack which may result in a denial of service. Most applications do not implement these traits directly, but inherit from a library. `jawn-parser-1.3.1` fixes this issue and users are advised to upgrade. For users unable to upgrade override `objectContext()` to use a collision-safe collection.
AI Analysis
Technical Summary
CVE-2022-21653 is a medium-severity vulnerability affecting the open source JSON parser library 'jawn', specifically versions prior to 1.3.2. Jawn is widely used in Scala-based applications for JSON parsing. The vulnerability arises from uncontrolled resource consumption (CWE-400) due to a hash collision attack targeting the internal data structures used during JSON object parsing. The issue specifically affects extenders of the 'org.typelevel.jawn.SimpleFacade' and 'org.typelevel.jawn.MutableFacade' traits who do not override the 'objectContext()' method. By default, these facades use a hash-based collection that is vulnerable to crafted inputs causing excessive hash collisions. An attacker can exploit this by sending specially crafted JSON payloads that trigger numerous hash collisions, leading to excessive CPU and memory consumption, resulting in denial of service (DoS). Most applications do not directly implement these traits but inherit them through libraries, which means the vulnerability can propagate indirectly through dependencies. The vulnerability was addressed in jawn-parser version 1.3.2 by either overriding 'objectContext()' to use a collision-resistant collection or other internal fixes. Users unable to upgrade are advised to override 'objectContext()' manually to mitigate the issue. There are no known exploits in the wild as of the published date, but the nature of the vulnerability makes it a potential vector for DoS attacks, especially in internet-facing services that parse untrusted JSON inputs. The vulnerability does not require authentication or user interaction, and the attack surface includes any service that parses JSON using vulnerable versions of jawn. Given the widespread use of JSON parsing libraries in microservices, APIs, and web applications, this vulnerability could impact a broad range of applications if they use the affected library versions without mitigation.
Potential Impact
For European organizations, the primary impact of CVE-2022-21653 is the risk of denial of service due to resource exhaustion. This can lead to service outages, degraded performance, and potential cascading failures in dependent systems. Organizations relying on Scala-based applications or services that incorporate the jawn JSON parser are at risk, particularly if these services are exposed to untrusted or external inputs such as public APIs, web services, or cloud-native applications. The DoS can affect availability, causing operational disruptions and potential financial losses. Additionally, prolonged outages can damage reputation and customer trust. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can indirectly affect business continuity and compliance with regulations such as GDPR, which mandates service reliability and data protection. Industries with critical real-time data processing, such as finance, telecommunications, and public sector services, may experience more severe consequences. The lack of known exploits reduces immediate risk, but the ease of triggering hash collisions with crafted JSON inputs means attackers with minimal resources could exploit this vulnerability if unpatched.
Mitigation Recommendations
Upgrade all instances of the jawn JSON parser to version 1.3.2 or later, where the vulnerability is fixed. For environments where upgrading is not immediately feasible, override the 'objectContext()' method in any extenders of 'SimpleFacade' or 'MutableFacade' to use a collision-resistant collection implementation, thereby mitigating hash collision attacks. Implement input validation and rate limiting on JSON inputs, especially for public-facing APIs, to reduce the risk of malicious payloads triggering resource exhaustion. Monitor application performance metrics and logs for unusual CPU or memory spikes during JSON parsing operations, which may indicate attempted exploitation. Incorporate dependency scanning tools in the CI/CD pipeline to detect vulnerable versions of jawn and other libraries early in the development lifecycle. Conduct security reviews of third-party libraries and transitive dependencies to identify indirect usage of vulnerable jawn versions. Consider deploying Web Application Firewalls (WAFs) or API gateways with JSON schema validation to block malformed or suspicious JSON payloads before they reach backend parsers.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Denmark, Belgium
CVE-2022-21653: CWE-400: Uncontrolled Resource Consumption in typelevel jawn
Description
Jawn is an open source JSON parser. Extenders of the `org.typelevel.jawn.SimpleFacade` and `org.typelevel.jawn.MutableFacade` who don't override `objectContext()` are vulnerable to a hash collision attack which may result in a denial of service. Most applications do not implement these traits directly, but inherit from a library. `jawn-parser-1.3.1` fixes this issue and users are advised to upgrade. For users unable to upgrade override `objectContext()` to use a collision-safe collection.
AI-Powered Analysis
Technical Analysis
CVE-2022-21653 is a medium-severity vulnerability affecting the open source JSON parser library 'jawn', specifically versions prior to 1.3.2. Jawn is widely used in Scala-based applications for JSON parsing. The vulnerability arises from uncontrolled resource consumption (CWE-400) due to a hash collision attack targeting the internal data structures used during JSON object parsing. The issue specifically affects extenders of the 'org.typelevel.jawn.SimpleFacade' and 'org.typelevel.jawn.MutableFacade' traits who do not override the 'objectContext()' method. By default, these facades use a hash-based collection that is vulnerable to crafted inputs causing excessive hash collisions. An attacker can exploit this by sending specially crafted JSON payloads that trigger numerous hash collisions, leading to excessive CPU and memory consumption, resulting in denial of service (DoS). Most applications do not directly implement these traits but inherit them through libraries, which means the vulnerability can propagate indirectly through dependencies. The vulnerability was addressed in jawn-parser version 1.3.2 by either overriding 'objectContext()' to use a collision-resistant collection or other internal fixes. Users unable to upgrade are advised to override 'objectContext()' manually to mitigate the issue. There are no known exploits in the wild as of the published date, but the nature of the vulnerability makes it a potential vector for DoS attacks, especially in internet-facing services that parse untrusted JSON inputs. The vulnerability does not require authentication or user interaction, and the attack surface includes any service that parses JSON using vulnerable versions of jawn. Given the widespread use of JSON parsing libraries in microservices, APIs, and web applications, this vulnerability could impact a broad range of applications if they use the affected library versions without mitigation.
Potential Impact
For European organizations, the primary impact of CVE-2022-21653 is the risk of denial of service due to resource exhaustion. This can lead to service outages, degraded performance, and potential cascading failures in dependent systems. Organizations relying on Scala-based applications or services that incorporate the jawn JSON parser are at risk, particularly if these services are exposed to untrusted or external inputs such as public APIs, web services, or cloud-native applications. The DoS can affect availability, causing operational disruptions and potential financial losses. Additionally, prolonged outages can damage reputation and customer trust. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can indirectly affect business continuity and compliance with regulations such as GDPR, which mandates service reliability and data protection. Industries with critical real-time data processing, such as finance, telecommunications, and public sector services, may experience more severe consequences. The lack of known exploits reduces immediate risk, but the ease of triggering hash collisions with crafted JSON inputs means attackers with minimal resources could exploit this vulnerability if unpatched.
Mitigation Recommendations
Upgrade all instances of the jawn JSON parser to version 1.3.2 or later, where the vulnerability is fixed. For environments where upgrading is not immediately feasible, override the 'objectContext()' method in any extenders of 'SimpleFacade' or 'MutableFacade' to use a collision-resistant collection implementation, thereby mitigating hash collision attacks. Implement input validation and rate limiting on JSON inputs, especially for public-facing APIs, to reduce the risk of malicious payloads triggering resource exhaustion. Monitor application performance metrics and logs for unusual CPU or memory spikes during JSON parsing operations, which may indicate attempted exploitation. Incorporate dependency scanning tools in the CI/CD pipeline to detect vulnerable versions of jawn and other libraries early in the development lifecycle. Conduct security reviews of third-party libraries and transitive dependencies to identify indirect usage of vulnerable jawn versions. Consider deploying Web Application Firewalls (WAFs) or API gateways with JSON schema validation to block malformed or suspicious JSON payloads before they reach backend parsers.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2021-11-16T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9848c4522896dcbf610d
Added to database: 5/21/2025, 9:09:28 AM
Last enriched: 6/22/2025, 4:21:24 AM
Last updated: 8/7/2025, 9:41:54 PM
Views: 11
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.