CVE catalog

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

[CVE catalog]

Severity
Medium · CVSS 6.5CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Published
Source
[NVD] · [CVE record]
EPSS
0.15% · Oct 25, 2026

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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debianruby-ojsid3.17.7-1fixed
Debianruby-ojforky3.17.7-1fixed
Debianruby-ojtrixie3.16.3-1vulnerable
Debianruby-ojtrixie-security3.16.3-1+deb13u1fixed
Debianruby-ojbookworm3.14.2-1vulnerable
Debianruby-ojbookworm-security3.14.2-1+deb12u1fixed
Cperuby-ojNot reportedNot reportedvulnerable

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianruby-ojsourcesid3.17.3-1not yet assignedNot reportedNot reported
Debianruby-ojsourceforky3.17.3-1not yet assignedNot reportedNot reported
Debianruby-ojsourcetrixie3.16.3-1+deb13u1not yet assignedNot reportedNot reported
Debianruby-ojsourcebookworm3.14.2-1+deb12u1not yet assignedNot reportedNot reported

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • [ruby-oj]Affected
    Details (2)
    • 3.14.2-1 · amd64 · bookworm

      Affected · Fixed: 3.14.2-1+deb12u1

      nvd · ruby-oj · debian · bookworm; nvd · ruby-oj · debian · 12

    • 3.14.2-1 · arm64 · bookworm

      Affected · Fixed: 3.14.2-1+deb12u1

      nvd · ruby-oj · debian · bookworm; nvd · ruby-oj · debian · 12

[Debian 13 (Trixie)]

  • [ruby-oj]Affected
    Details (3)
    • 3.16.3-1+b5 · amd64 · trixie

      Affected · Fixed: 3.16.3-1+deb13u1

      nvd · ruby-oj · debian · 13

    • 3.16.3-1+b5 · arm64 · trixie

      Affected · Fixed: 3.16.3-1+deb13u1

      nvd · ruby-oj · debian · 13

    • 3.16.3-1+deb13u1 · amd64 · trixie-security

      Fixed · Fixed: 3.16.3-1+deb13u1

      nvd · ruby-oj · debian · 13

Observed:

References