Oj: intern.c form_attr has an uninitialized stack read
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-125 and the CVSS impact.
Summary
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.3, Oj.load in :object mode reads uninitialized stack memory (and, for long keys, reads out of bounds) when parsing a JSON object whose key is 254 bytes or longer. The interned bytes can surface to the caller, disclosing process stack memory. In ext/oj/intern.c, form_attr() handles the long-key path by allocating a heap buffer, `b`, populating it with the attribute name, and then freeing it — but it passed the uninitialized stack buffer buf (not b) to rb_intern3(). rb_intern3 therefore reads len + 1 bytes of uninitialized stack memory. When the key length is >= 256, it also reads out of bounds past the 256-byte buf. The resulting bytes are interned and can reach the caller via the produced Symbol or via the EncodingError message raised on invalid UTF-8, leaking process stack contents. This issue has been fixed in version 3.17.3.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ohler55 | oj | before 3.17.3 | 3.17.3 | Patch available | CNA |
| — | oj (RubyGems) | before 3.17.3 | 3.17.3 | Patch available | GHSA-fm7p-mprw-wjm9 |
- oj Vendorohler55 Affected before 3.17.3 Fixed in 3.17.3 Patch available CNA
- oj (RubyGems) Vendor— Affected before 3.17.3 Fixed in 3.17.3 Patch available GHSA-fm7p-mprw-wjm9
Remediation
- Fix · CNA oj (ohler55) Fixed in 3.17.3
- Fix · GHSA-fm7p-mprw-wjm9 oj (RubyGems) Fixed in 3.17.3 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2026-54500
- 2026-10-03 Alias added: GHSA-fm7p-mprw-wjm9
References
More ohler55 vulnerabilities
- TI-2026-39426 Oj: Stack Buffer Overflow in Oj::Doc#each_child via Deeply Nested Input CVSS 3.1HIGH 7.5
- TI-2026-39672 Oj: Negative-Size memcpy in Oj::Parser create_id Attribute Handling CVSS 4.0MEDIUM 6.3
- TI-2026-39348 Oj: Stack Buffer Overflow in Oj.dump via Large Indent CVSS 4.0MEDIUM 6.3
- TI-2026-39675 Oj: Integer Overflow in Oj.load 2GB String Handling CVSS 4.0MEDIUM 6.3
- TI-2026-39674 Oj: Use-After-Free in Oj::Parser SAJ Long Key Callback CVSS 4.0MEDIUM 6.3
- TI-2026-39673 Oj: Use-After-Free in Oj::Parser array_class/hash_class GC Marking CVSS 4.0MEDIUM 6.3
Sources
- CVE-2026-54500 · CVE Program
- CVE-2026-54500 · NVD
- FIRST EPSS
- GHSA-fm7p-mprw-wjm9 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-54500 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences