Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.3, Oj::Doc#eachchild, 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, doceachchild increments doc->where past the wherepath[MAXSTACK = 100] array with no bounds check and never restores it (the doc->where-- is missing), so calling eachchild 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 savepath[MAXSTACK] using wlen = doc->where - doc->wherepath, so when the previous recursive call left doc->where past wherepath[100] the wlen exceeds MAXSTACK and the memcpy overflows savepath 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.