Vulnerability
CVE-2026-54898
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.2,Oj::Parser#parse is vulnerable to a heap use-after-free when a SAJ/SAJ2 callback mutates the input JSON string during parsing. The C engine holds a raw const byte * pointer into the Ruby string's internal buffer. If a callback (e.g. hash_start) resizes the string — for example by calling String#replace with a longer value — Ruby reallocates the string buffer and frees the old one. The C parser's pointer is left dangling; the next character read at parser.c:607 is a use-after-free. This issue has been fixed in version 3.17.2.
65 advisories report this vulnerability, across 5 ecosystems.
Advisories in Wolfi
- CGA-256x-24mv-f664
- CGA-37pv-gx5r-m2c2
- CGA-6wv6-mrgf-prv9
- CGA-76m7-x639-g2v5
- CGA-8x7c-4h7p-vphx
- CGA-8xqx-52jj-v4mf
- CGA-f7r8-83pc-5xc8
- CGA-j7g3-9h92-7m9m
- CGA-j7j3-95vh-3vp4
- CGA-jpx2-x7rc-5r9v
- CGA-m724-7chp-r592
- CGA-q3ch-cj9r-mm28
- CGA-r3f7-v663-2fhq
- CGA-rchj-4qw8-32gc
- CGA-vqcj-grw9-3rfh
- CGA-wm8w-hrp4-58vq