# CVE-2026-54592: Oj: Stack Buffer Overflow in Oj::Doc#each_child via Deeply Nested Input

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.33%, higher than 27% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-19T19:36:28.000Z
- Modified: 2026-10-25T17:10:00.197Z
- Also known as: GHSA-3m6q-jj5j-38c9
- Weaknesses: CWE-125, CWE-787
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.3, Oj::Doc#each_child, when invoked recursively over a deeply nested JSON document, overflows a fixed-size stack buffer and aborts the process, leading to DoS.  In a two-step chain in ext/oj/fast.c, doc_each_child increments doc->where past the where_path[MAX_STACK = 100] array with no bounds check and never restores it (the doc->where-- is missing), so calling each_child recursively from inside the yield block drives doc->where beyond the array. On the next entry  the function copies the path into the 800-byte stack-local buffer save_path[MAX_STACK]  using wlen = doc->where - doc->where_path, so when the previous recursive call left doc->where past where_path[100] the wlen exceeds MAX_STACK and  the memcpy overflows save_path on the C stack; because the Oj::Doc parser imposes no JSON nesting-depth limit (relying on a C-stack pressure check), deeply nested attacker input reaches this path. This issue has been fixed in version 3.17.3.

(As written by CVE List.)

## Affected

- ohler55 oj: < 3.17.3
- oj (RubyGems): before 3.17.3

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/ohler55/oj/security/advisories/GHSA-3m6q-jj5j-38c9> (exploit, web)
- <https://github.com/ohler55/oj> (package)

## Sources

- CVE List: [CVE-2026-54592](https://www.cve.org/CVERecord?id=CVE-2026-54592), CVE Terms of Use, modified 2026-07-01
- GitHub Advisory Database: [GHSA-3m6q-jj5j-38c9](https://github.com/advisories/GHSA-3m6q-jj5j-38c9), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-54592](https://nvd.nist.gov/vuln/detail/CVE-2026-54592), Public domain, modified 2026-10-25

---

Page: https://cve.day/CVE-2026-54592 · Whole record: https://cve.day/CVE-2026-54592.json · Rebuilt by cve.day 2026-11-25T22:59:26.855Z
