CVE-2026-54902: CWE-416: Use After Free in ohler55 oj
Oj (Optimized JSON) Ruby gem versions prior to 3.17.2 contain a Use-After-Free vulnerability in SAJ mode. The vulnerability arises because cached object keys of 35 bytes or more are not protected from garbage collection. A Ruby callback triggering garbage collection inside hash_end can cause the key string to be freed while still referenced by the C parser, leading to a segmentation fault. This issue is fixed in version 3.17.2.
AI Analysis
Technical Summary
CVE-2026-54902 is a Use-After-Free vulnerability in the Oj Ruby gem before version 3.17.2 when operating in SAJ mode. The Oj::Parser does not safeguard cached object keys (≥ 35 bytes) from garbage collection. If a Ruby callback triggers garbage collection during the hash_end phase, the key string may be reclaimed while the C parser still holds a pointer to it. Accessing this freed memory results in a segmentation fault, with evidence of control over the freed memory content indicated by an RIP pointing to a canary pattern (0x4242). The vulnerability has been addressed in version 3.17.2.
Potential Impact
Exploitation of this vulnerability can cause a segmentation fault (crash) in applications using vulnerable versions of the Oj gem in SAJ mode. The crash occurs due to use of freed memory, which may allow attackers to influence program behavior or cause denial of service. There are no known exploits in the wild as of the published date. The CVSS 4.0 base score is 6.3, indicating a medium severity impact with network attack vector and low attack complexity.
Mitigation Recommendations
Upgrade to Oj version 3.17.2 or later, where this Use-After-Free vulnerability is fixed. No other mitigations are indicated. Patch status is confirmed fixed in 3.17.2.
CVE-2026-54902: CWE-416: Use After Free in ohler55 oj
Description
Oj (Optimized JSON) Ruby gem versions prior to 3.17.2 contain a Use-After-Free vulnerability in SAJ mode. The vulnerability arises because cached object keys of 35 bytes or more are not protected from garbage collection. A Ruby callback triggering garbage collection inside hash_end can cause the key string to be freed while still referenced by the C parser, leading to a segmentation fault. This issue is fixed in version 3.17.2.
CVSS v4.0
Score 6.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-54902 is a Use-After-Free vulnerability in the Oj Ruby gem before version 3.17.2 when operating in SAJ mode. The Oj::Parser does not safeguard cached object keys (≥ 35 bytes) from garbage collection. If a Ruby callback triggers garbage collection during the hash_end phase, the key string may be reclaimed while the C parser still holds a pointer to it. Accessing this freed memory results in a segmentation fault, with evidence of control over the freed memory content indicated by an RIP pointing to a canary pattern (0x4242). The vulnerability has been addressed in version 3.17.2.
Potential Impact
Exploitation of this vulnerability can cause a segmentation fault (crash) in applications using vulnerable versions of the Oj gem in SAJ mode. The crash occurs due to use of freed memory, which may allow attackers to influence program behavior or cause denial of service. There are no known exploits in the wild as of the published date. The CVSS 4.0 base score is 6.3, indicating a medium severity impact with network attack vector and low attack complexity.
Mitigation Recommendations
Upgrade to Oj version 3.17.2 or later, where this Use-After-Free vulnerability is fixed. No other mitigations are indicated. Patch status is confirmed fixed in 3.17.2.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-16T13:49:33.555Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a445a0927e9c7971999d8a0
Added to database: 07/01/2026, 00:06:33 UTC
Last enriched: 07/01/2026, 00:21:55 UTC
Last updated: 07/01/2026, 00:21:55 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.