CVE-2026-54502: CWE-121: Stack-based Buffer Overflow in ohler55 oj
Oj (Optimized JSON) is a Ruby gem for JSON parsing and marshalling. Versions prior to 3.17.2 contain a stack-based buffer overflow vulnerability in the Oj.dump function when a large :indent value is used. The vulnerability arises because the fill_indent function calls memset with the indent size unchecked, allowing an attacker to cause a stack overflow by specifying a very large indent value such as INT_MAX. This issue has been fixed in version 3.17.2.
AI Analysis
Technical Summary
CVE-2026-54502 is a stack-based buffer overflow vulnerability in the Oj Ruby gem (versions before 3.17.2). The vulnerability occurs in the Oj.dump function when a large :indent parameter is provided. Specifically, the fill_indent function calls memset to fill an indent string buffer on the stack without validating the size of the indent parameter. If opts->indent is set to INT_MAX (2,147,483,647), memset attempts to write approximately 2 GB into a stack-allocated buffer of only 4,184 bytes, causing stack corruption and process crash. This vulnerability is addressed in version 3.17.2.
Potential Impact
Exploitation of this vulnerability can cause a stack-based buffer overflow leading to stack corruption and process crashes. This may result in denial of service or potentially enable further exploitation depending on the environment. The CVSS 4.0 base score is 6.3 (medium severity), indicating a significant but not critical impact. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade to Oj version 3.17.2 or later, where this vulnerability has been fixed. Since the issue is resolved in the fixed version, no additional mitigation steps are required.
CVE-2026-54502: CWE-121: Stack-based Buffer Overflow in ohler55 oj
Description
Oj (Optimized JSON) is a Ruby gem for JSON parsing and marshalling. Versions prior to 3.17.2 contain a stack-based buffer overflow vulnerability in the Oj.dump function when a large :indent value is used. The vulnerability arises because the fill_indent function calls memset with the indent size unchecked, allowing an attacker to cause a stack overflow by specifying a very large indent value such as INT_MAX. 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-54502 is a stack-based buffer overflow vulnerability in the Oj Ruby gem (versions before 3.17.2). The vulnerability occurs in the Oj.dump function when a large :indent parameter is provided. Specifically, the fill_indent function calls memset to fill an indent string buffer on the stack without validating the size of the indent parameter. If opts->indent is set to INT_MAX (2,147,483,647), memset attempts to write approximately 2 GB into a stack-allocated buffer of only 4,184 bytes, causing stack corruption and process crash. This vulnerability is addressed in version 3.17.2.
Potential Impact
Exploitation of this vulnerability can cause a stack-based buffer overflow leading to stack corruption and process crashes. This may result in denial of service or potentially enable further exploitation depending on the environment. The CVSS 4.0 base score is 6.3 (medium severity), indicating a significant but not critical impact. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade to Oj version 3.17.2 or later, where this vulnerability has been fixed. Since the issue is resolved in the fixed version, no additional mitigation steps are required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-15T18:01:15.512Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
- Gcve Source
- db.gcve.eu
Threat ID: 6a446e6e27e9c79719c50917
Added to database: 07/01/2026, 01:33:34 UTC
Last enriched: 07/01/2026, 01:37:12 UTC
Last updated: 07/01/2026, 01:51:11 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.