Skip to content
Heist/ feed
Back to feed
Low

ruby-oj — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-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.

Products
ruby-oj
Affected versions
2.0.10-1, 2.1.4-1, 2.12.10-3, 2.12.10-3build1, 2.12.10-4, 2.12.10-4build1, 2.17.4-1, 2.4.0-1, 2.5.3-1, 3.10.1-1, 3.10.1-1build1, 3.11.0-1, 3.13.7-1, 3.13.7-1build1, 3.13.9-1, 3.13.9-1build1, 3.15.0-1, 3.16.1-1, 3.16.12-1, 3.16.15-1, 3.16.3-1, 3.16.3-1build1, 3.16.3-1build2, 3.16.3-1build3, 3.17.0-1, 3.17.1-1, 3.17.3-1, 3.17.4-1, 3.4.0-1, 3.4.0-1build1, 3.8.1-1, 3.9.1-1, 3.9.2-1
Fixed versions
Not specified
CVEs
CVE-2026-54898
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 03:08 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-54898

core-osv · Original source

Published 1 Jul 2026, 00:16 UTC

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.

osv:UBUNTU-CVE-2026-54898

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

ruby-oj

Fixed versions: Not specified

Complete source record
{
  "id": "15111078cb7d6acf6fb5510118d0127d027d1c62319caa697fe7024ec291343d",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-54898",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-54898",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2026-54898",
    "products": [
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.0.10-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.1.4-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.4.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.5.3-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.12.10-3",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "2.12.10-3build1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "2.12.10-4",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "2.12.10-4build1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.17.4-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.4.0-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.4.0-1build1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.8.1-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "3.9.1-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "3.9.2-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "3.10.1-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "3.10.1-1build1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.11.0-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.13.7-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.13.7-1build1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.13.9-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.13.9-1build1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.15.0-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.16.1-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.16.3-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.16.3-1build1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.16.3-1build2",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.16.3-1build3",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.16.15-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "3.17.0-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "3.17.1-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "3.17.3-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "3.17.4-1",
            "evidence": "/affected/7/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-oj",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.16.3-1build3",
            "evidence": "/affected/8/versions"
          },
          {
            "value": "3.16.12-1",
            "evidence": "/affected/8/versions"
          },
          {
            "value": "3.16.15-1",
            "evidence": "/affected/8/versions"
          }
        ]
      }
    ],
    "severity": "low",
    "structured": {
      "id": "UBUNTU-CVE-2026-54898",
      "aliases": [
        "UBUNTU-CVE-2026-54898"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=trusty",
            "ecosystem": "Ubuntu:14.04:LTS"
          },
          "versions": [
            "2.0.10-1",
            "2.1.4-1",
            "2.4.0-1",
            "2.5.3-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "2.5.3-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "2.12.10-3",
            "2.12.10-3build1",
            "2.12.10-4",
            "2.12.10-4build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "2.12.10-4build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "2.17.4-1",
            "3.4.0-1",
            "3.4.0-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.4.0-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "3.8.1-1",
            "3.9.1-1",
            "3.9.2-1",
            "3.10.1-1",
            "3.10.1-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.10.1-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "3.11.0-1",
            "3.13.7-1",
            "3.13.7-1build1",
            "3.13.9-1",
            "3.13.9-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.13.9-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "3.15.0-1",
            "3.16.1-1",
            "3.16.3-1",
            "3.16.3-1build1",
            "3.16.3-1build2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.16.3-1build2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "3.16.3-1build3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.16.3-1build3"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "3.16.15-1",
            "3.17.0-1",
            "3.17.1-1",
            "3.17.3-1",
            "3.17.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.17.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-oj",
            "purl": "pkg:deb/ubuntu/ruby-oj?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "3.16.3-1build3",
            "3.16.12-1",
            "3.16.15-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-54898.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-oj",
                "binary_version": "3.16.15-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T13:00:26.036010712Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-54898"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-54898",
        "https://www.cve.org/CVERecord?id=CVE-2026-54898",
        "https://github.com/ohler55/oj/security/advisories/GHSA-q2gm-54r6-8fwm"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-54898",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 360534,
  "published_at": "2026-07-01T00:16:00+00:00"
}