Vulnerability
CVE-2026-54502
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.2, Oj.dump is vulnerable to a stack-based buffer overflow when a large :indent value is provided by the developer. fill_indent in dump.h calls memset(indent_str, ' ', (size_t)opts->indent) without validating the size. When opts->indent is set to INT_MAX (2,147,483,647), the (size_t) cast preserves the large value and memset writes 2 GB into the stack-allocated out buffer (4,184 bytes), corrupting the stack and crashing the process. This issue has been fixed in version 3.17.2.
65 advisories report this vulnerability, across 5 ecosystems.
Advisories in Wolfi
- CGA-5c8h-w3j6-mhvc
- CGA-5wjf-6mpr-cf77
- CGA-69gc-8rgh-cj82
- CGA-8h37-v49w-h55r
- CGA-9j82-cx27-fj8v
- CGA-f8pg-87q4-5qfp
- CGA-fxv6-f24q-7pw3
- CGA-gcp2-52p8-976c
- CGA-gcq5-8cx8-qfj9
- CGA-gj92-5g4c-8qrf
- CGA-p8c5-3f77-qgh5
- CGA-ppjp-xr6c-5fwc
- CGA-qjpj-4xrw-8gq8
- CGA-qm45-2qjc-8f8x
- CGA-rc3c-mmfw-gv54
- CGA-rx5r-q9vj-9q75