ruby-oj — security advisory
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to 3.17.2, Oj::Doc iterators (each_value, each_child, each_leaf) were vulnerable to a heap use-after-free. When a Ruby block yielded during iteration calls doc.close or d.close, the document's heap memory is freed while the C iterator is still running. When control returns from the block, the iterator reads from the freed region, producing a use-after-free accessible from pure Ruby. 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-54897
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 03:08 UTC · Revision 1
Source evidence
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to 3.17.2, Oj::Doc iterators (each_value, each_child, each_leaf) were vulnerable to a heap use-after-free. When a Ruby block yielded during iteration calls doc.close or d.close, the document's heap memory is freed while the C iterator is still running. When control returns from the block, the iterator reads from the freed region, producing a use-after-free accessible from pure Ruby. This issue has been fixed in version 3.17.2.
osv:UBUNTU-CVE-2026-54897
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": "cba59d4305bf9713ed94c0c47d5c447859fb05e830621316e5ccc0d1ba2c4f93",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-54897",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2026-54897",
"summary": "Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to 3.17.2, Oj::Doc iterators (each_value, each_child, each_leaf) were vulnerable to a heap use-after-free. When a Ruby block yielded during iteration calls doc.close or d.close, the document's heap memory is freed while the C iterator is still running. When control returns from the block, the iterator reads from the freed region, producing a use-after-free accessible from pure Ruby. This issue has been fixed in version 3.17.2.",
"evidence": "osv:UBUNTU-CVE-2026-54897",
"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-54897",
"aliases": [
"UBUNTU-CVE-2026-54897"
],
"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-54897.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-54897.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-54897.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-54897.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-54897.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-54897.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-54897.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-54897.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-54897.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-oj",
"binary_version": "3.16.15-1"
}
]
}
}
],
"modified": "2026-10-17T13:00:26.199248996Z",
"provider": "osv",
"upstream": [
"CVE-2026-54897"
],
"references": [
"https://ubuntu.com/security/CVE-2026-54897",
"https://www.cve.org/CVERecord?id=CVE-2026-54897",
"https://github.com/ohler55/oj/security/advisories/GHSA-9ppp-w3g4-fh4q"
]
},
"related_cves": [
{
"value": "CVE-2026-54897",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 360540,
"published_at": "2026-07-01T00:16:00+00:00"
}