json is vulnerable to Use After Free
45
Medium Risk
JSON::ResumableParser#parse clears the consumed input buffer at end-of-stream but leaves state.start, state.cursor, and state.end pointing into the released storage. When an application later calls partial_value on an incomplete object that contains duplicate keys, the duplicate-key warning path invokes cursor_position, which walks those stale pointers and reads freed memory. An attacker who can feed a crafted truncated JSON stream to a resumable parser and trigger partial_value can crash the Ruby process via this heap use-after-free. The fix resets the parser-state pointers when the buffer is cleared and skips cursor-based line/column computation on the resumable warning path.
You are affected if you are using a version that falls within the vulnerable range and your application uses JSON::ResumableParser with partial_value on untrusted streaming JSON input.
json is vulnerable to Use After Free in versions 2.20.0 - 2.21.1.
Upgrade the json library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant