Vulnerability
CVE-2026-54592
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.
65 advisories report this vulnerability, across 5 ecosystems.
Advisories in Wolfi
- CGA-29rf-v244-hf86
- CGA-2g53-8mm8-f4j2
- CGA-32h6-9vcc-279f
- CGA-3rwg-r4r6-jc5c
- CGA-83xj-xvpm-m436
- CGA-983r-gwh3-g33g
- CGA-c9hr-56r4-69v4
- CGA-frqq-8fqf-qh6q
- CGA-hw4w-wr7h-h89f
- CGA-jfq4-2c57-xjww
- CGA-mq53-34j4-pgvh
- CGA-qc8f-5m73-p53c
- CGA-qcm3-fh6c-5f6f
- CGA-qr4w-jm5r-8vpw
- CGA-r8qq-mpvv-9qfc
- CGA-wc5x-p7mv-c4mp