AsyncParser can be forced to perform O(n^2) work on the length of the input. When a single JSON token arrives across many small chunks, each absorb call rescans the incomplete token from the start.
// impactDenial of service via CPU exhaustion when parsing untrusted JSON.
Preconditions:
- Application uses AsyncParser
- Attacker can send large tokens with control over chunk sizes.
Fixed in jawn-parser-1.7.0.
// workaroundsIf you can't upgrade immediately:
- Use the synchronous Parser.
- Buffer incoming bytes into larger chunks before calling absorb
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High