CVE-2026-54902: CWE-416: Use After Free in ohler55 oj
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to version 3.17.2, is vulnerable to Use-After-Free when in SAJ mode. The Oj::Parser does not protect cached object keys (≥ 35 bytes) from garbage collection, and a Ruby callback that triggers GC inside hash_end can cause the key string to be reclaimed while the C parser still holds a pointer to it. The subsequent access to the freed string VALUE results in a segfault, confirmed by an RIP pointing to address 0x4242 (a canary-style pattern suggesting control over the freed memory's content). This issue has been fixed in version 3.17.2.
AI Analysis
Technical Summary
CVE-2026-54902 is a Use-After-Free vulnerability in the ohler55 oj Ruby gem, affecting versions before 3.17.2. The vulnerability occurs in SAJ mode when the Oj::Parser caches object keys of at least 35 bytes without protecting them from Ruby's garbage collector. If a Ruby callback triggers garbage collection inside the hash_end function, the cached key string may be reclaimed while the C parser still references it. Subsequent access to 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-style pattern (0x4242). The issue was resolved 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 results from accessing freed memory, which may allow an attacker to control the content of the freed memory area. No known exploits in the wild have been reported. The CVSS 4.0 base score is 6.3 (medium severity), indicating a moderate impact with network attack vector, low attack complexity, and limited availability impact.
Mitigation Recommendations
This vulnerability is fixed in oj version 3.17.2. Users should upgrade to version 3.17.2 or later to remediate the issue. No other official remediation or temporary fixes are indicated. Since this is not a cloud service, remediation depends on user action to update the gem.
CVE-2026-54902: CWE-416: Use After Free in ohler55 oj
Description
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to version 3.17.2, is vulnerable to Use-After-Free when in SAJ mode. The Oj::Parser does not protect cached object keys (≥ 35 bytes) from garbage collection, and a Ruby callback that triggers GC inside hash_end can cause the key string to be reclaimed while the C parser still holds a pointer to it. The subsequent access to the freed string VALUE results in a segfault, confirmed by an RIP pointing to address 0x4242 (a canary-style pattern suggesting control over the freed memory's content). This issue has been 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 ohler55 oj Ruby gem, affecting versions before 3.17.2. The vulnerability occurs in SAJ mode when the Oj::Parser caches object keys of at least 35 bytes without protecting them from Ruby's garbage collector. If a Ruby callback triggers garbage collection inside the hash_end function, the cached key string may be reclaimed while the C parser still references it. Subsequent access to 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-style pattern (0x4242). The issue was resolved 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 results from accessing freed memory, which may allow an attacker to control the content of the freed memory area. No known exploits in the wild have been reported. The CVSS 4.0 base score is 6.3 (medium severity), indicating a moderate impact with network attack vector, low attack complexity, and limited availability impact.
Mitigation Recommendations
This vulnerability is fixed in oj version 3.17.2. Users should upgrade to version 3.17.2 or later to remediate the issue. No other official remediation or temporary fixes are indicated. Since this is not a cloud service, remediation depends on user action to update the gem.
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/08/2026, 13:01:29 UTC
Last updated: 08/14/2026, 12:41:11 UTC
Views: 86
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.