{"id":"CVE-2026-54898","published":"2026-06-30T23:24:23Z","modified":"2026-07-01T13:36:50Z","title":"Oj: Use-After-Free in Oj::Parser SAJ Callback via Input Mutation","vendor":"ohler55","product":"oj","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.1,"severity":"LOW","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00203,"percentile":0.10502,"provenance":"source"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"references":[{"url":"https://github.com/ohler55/oj/security/advisories/GHSA-q2gm-54r6-8fwm","tags":["x_refsource_CONFIRM"]}],"priority":{"score":3.6,"factors":[{"name":"EPSS percentile","points":2.1},{"name":"CVSS severity","points":1.47}]},"vendorSlug":"ohler55","affectedVersions":[{"vendor":"ohler55","product":"oj","versions":["< 3.17.2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-01T13:36:39.350965Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"oj","vulnerableRanges":["<3.17.3"],"patched":["3.17.3"],"from":["GHSA-q2gm-54r6-8fwm"],"provenance":"source"}],"summary":{"text":"The Oj gem (ohler55/oj, the Optimized JSON parser for Ruby) has a use-after-free in its Oj::Parser SAJ/SAJ2 callback path, where the C parser keeps a raw pointer into a Ruby string's buffer that a callback can free by resizing the string during parsing.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:45Z"},"euvd":{"id":"EUVD-2026-40854","exploited":false,"provenance":"source"}}