Skip to main content

Ruby oj: Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. (CVE-2026-54902)

0
Medium
Published: 07/01/2026 (07/01/2026, 00:16:00 UTC)
Source: GCVE Database
Product: ruby-oj

Description

Oj (Optimized JSON) is a Ruby gem for JSON parsing and object marshalling. Versions prior to 3.17.2 are vulnerable to a Use-After-Free issue in SAJ mode. The vulnerability occurs because Oj::Parser does not protect cached object keys of 35 bytes or more from garbage collection. A Ruby callback triggering garbage collection inside hash_end can cause the key string to be freed while the C parser still holds a pointer to it, leading to a segmentation fault. This issue has been fixed in version 3.17.2.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Affected software

Ubuntu:14.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=trusty
Affected versions
=2.0.10-1=2.1.4-1=2.4.0-1=2.5.3-1
Ubuntu:16.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=xenial
Affected versions
=2.12.10-3=2.12.10-3build1=2.12.10-4=2.12.10-4build1
Ubuntu:18.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=bionic
Affected versions
=2.17.4-1=3.4.0-1=3.4.0-1build1
Ubuntu:20.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=focal
Affected versions
=3.8.1-1=3.9.1-1=3.9.2-1=3.10.1-1=3.10.1-1build1
Ubuntu:22.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=jammy
Affected versions
=3.11.0-1=3.13.7-1=3.13.7-1build1=3.13.9-1=3.13.9-1build1
Ubuntu:24.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=noble
Affected versions
=3.15.0-1=3.16.1-1=3.16.3-1=3.16.3-1build1=3.16.3-1build2
Ubuntu:25.10more threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=questing
Affected versions
=3.16.3-1build3
Ubuntu:26.10more threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=stonking
Affected versions
=3.16.15-1=3.17.0-1=3.17.1-1=3.17.3-1=3.17.4-1
Ubuntu:26.04:LTSmore threats →ghsa
ruby-oj
pkg:deb/ubuntu/ruby-oj?arch=source&distro=resolute
Affected versions
=3.16.3-1build3=3.16.12-1=3.16.15-1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/18/2026, 00:47:14 UTC

Technical Analysis

The Ruby gem Oj (Optimized JSON) suffers from a Use-After-Free vulnerability in versions before 3.17.2 when operating in SAJ mode. The parser caches object keys but does not prevent garbage collection of keys that are 35 bytes or longer. If a Ruby callback triggers garbage collection during the hash_end phase, the key string may be reclaimed while the C parser still references it. Accessing this freed memory causes a segmentation fault, with evidence of potential memory control indicated by an RIP address pointing to a canary pattern (0x4242). The vulnerability has been addressed and fixed in version 3.17.2.

Potential Impact

Exploitation of this vulnerability results in a Use-After-Free condition causing a segmentation fault (crash) in applications using vulnerable versions of the Oj gem in SAJ mode. The crash is due to accessing freed memory, which may allow an attacker to control the content of the freed memory region, potentially leading to denial of service or other memory corruption consequences. No confirmed exploits in the wild are reported.

Mitigation Recommendations

Upgrade to Oj version 3.17.2 or later, where this Use-After-Free vulnerability has been fixed. No other mitigations are indicated or required according to the available data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
UBUNTU-CVE-2026-54902
Osv Schema Version
1.7.0
Ecosystems
["Ubuntu:14.04:LTS","Ubuntu:16.04:LTS","Ubuntu:18.04:LTS","Ubuntu:20.04:LTS","Ubuntu:22.04:LTS","Ubuntu:24.04:LTS","Ubuntu:25.10","Ubuntu:26.10","Ubuntu:26.04:LTS"]
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6ad3f5f52cdf04f656663533

Added to database: 10/17/2026, 22:25:57 UTC

Last enriched: 10/18/2026, 00:47:14 UTC

Last updated: 10/18/2026, 00:47:14 UTC

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses