CVE-2026-54592
Full vulnerability record from the local CVENow database.
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.
View original CVE JSON
{
"id": "CVE-2026-54592",
"sourceIdentifier": "[email protected]",
"published": "2026-07-01T00:16:32.743",
"lastModified": "2026-10-25T17:10:00.197",
"vulnStatus": "Deferred",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "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."
},
{
"lang": "es",
"value": "Oj (JSON Optimizado) es un analizador JSON y un serializador de objetos empaquetado como una gema Ruby. En versiones anteriores a la 3.17.3, Oj::Doc#each_child, cuando se invoca recursivamente sobre un documento JSON profundamente anidado, desborda un búfer de pila de tamaño fijo y aborta el proceso, lo que lleva a DoS. En una cadena de dos pasos en ext/oj/fast.c, doc_each_child incrementa doc -> where más allá del array where_path[MAX_STACK = 100] sin verificación de límites y nunca lo restaura (falta el doc -> where--), por lo que llamar a each_child recursivamente desde dentro del bloque yield lleva a doc -> where más allá del array. En la siguiente entrada, la función copia la ruta en el búfer local de pila de 800 bytes save_path[MAX_STACK] usando wlen = doc -> where - doc -> where_path, por lo que cuando la llamada recursiva anterior dejó doc -> where más allá de where_path[100], el wlen excede MAX_STACK y el memcpy desborda save_path en la pila C; debido a que el analizador Oj::Doc no impone un límite de profundidad de anidamiento JSON (confiando en una verificación de presión de la pila C), la entrada del atacante profundamente anidada alcanza esta ruta. Este problema ha sido solucionado en la versión 3.17.3."
}
],
"affected": [
{
"source": "[email protected]",
"affectedData": [
{
"vendor": "ohler55",
"product": "oj",
"versions": [
{
"version": "< 3.17.3",
"status": "affected"
}
]
}
]
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "[email protected]",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"availabilityImpact": "HIGH"
},
"exploitabilityScore": 3.9,
"impactScore": 3.6
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"timestamp": "2026-07-01T12:35:37.238466Z",
"id": "CVE-2026-54592",
"options": [
{
"exploitation": "poc"
},
{
"automatable": "yes"
},
{
"technicalImpact": "partial"
}
],
"role": "CISA Coordinator",
"version": "2.0.3"
}
}
]
},
"weaknesses": [
{
"source": "[email protected]",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-125"
},
{
"lang": "en",
"value": "CWE-787"
}
]
}
],
"references": [
{
"url": "https://github.com/ohler55/oj/security/advisories/GHSA-3m6q-jj5j-38c9",
"source": "[email protected]"
},
{
"url": "https://github.com/ohler55/oj/security/advisories/GHSA-3m6q-jj5j-38c9",
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
}
]
}