AI Science Tracker

Oj SAJ parser use-after-free for long object keys

Oj · AI involvement attributed to depthfirst AI security agents (specific model not identified for this Ruby research)

Finding and attribution

In SAJ mode, a Ruby callback that triggers garbage collection can reclaim a long key string while Oj’s native parser still retains the Ruby VALUE, resulting in access through a stale reference and a segfault.

Product: Oj. AI system: depthfirst AI security agents (specific model not identified for this Ruby research). Team / organization: depthfirst / respective project maintainers.

CVE identifiers: CVE-2026-54902.

AI and human contribution (source account): depthfirst’s primary July 27, 2026 Ruby ecosystem report identifies CVE-2026-54902 as an issue uncovered in the research, and says its AI security agents analyzed the projects and validated each finding with a triggering input, reproduction script and evidence such as ASan output before manual review. The issue-specific section describes this exact vulnerability. The affected project maintainer advisory validates the vulnerability and fix. No specific model or per-case human/agent split is stated.

Human involvement is only described where the source account establishes it; unknown involvement does not mean none. Vendor confirmation of a flaw does not confirm every claim about AI contribution.

Discovery context: The maintainer advisory and CNA record provide public dates for CVE-2026-54902; the depthfirst account is dated 2026-07-27. The sources do not report exploitation in the wild or establish zero-day status.

Remediation status: fix documented. Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to version 3.17.2, is vulnerable to Use-After-Free when in SAJ mode. The Oj::Parser does not protect cached object keys (≥ 35 bytes) from garbage collection, and a Ruby callback that triggers GC inside hash_end can cause the key string to be reclaimed while the C parser still holds a pointer to it. The subsequent access to the freed string VALUE results in a segfault, confirmed by an RIP pointing to address 0x4242 (a canary-style pattern suggesting control over the freed memory's content). This issue has been fixed in version 3.17.2. This documents upstream package version guidance and does not establish downstream distribution patch state.

A source-documented fix does not establish installed patches or current safety. Source checking does not independently reproduce the finding or establish observed exploitation.

Disclosed 30 Jun 2026. AI attribution dated 27 Jul 2026. Sources checked 17 Nov 2026; these are separate dates, not a live installation check.

Recorded CVSS: Medium · highest recorded score 6.3. Documented technical effects: denial of service.

Severity, consequences and exploitation evidence

Case grouping uses the highest recorded CVSS score, with its version-specific severity band. It is descriptive, not a combined or editorial risk index. All recorded assessments remain below; scores from different versions and sources may disagree. CVSS specifications define version-specific scoring and severity bands.

  • CVE-2026-54902: CVSS 4.0 · 6.3 (Medium) · 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. CNA CVE Program record · checked 17 Nov 2026.

CVE-2026-54902: denial of service.
Prerequisites / affected scope: Oj SAJ mode must parse an object key of at least 35 bytes and a Ruby callback must trigger GC while the nested object remains open..
Exploitation evidence: The maintainer advisory reproduces a segfault. It does not describe exploitation in the wild or establish a general remote denial-of-service path.. Impact source · checked 17 Nov 2026.

Documented fix: Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to version 3.17.2, is vulnerable to Use-After-Free when in SAJ mode. The Oj::Parser does not protect cached object keys (≥ 35 bytes) from garbage collection, and a Ruby callback that triggers GC inside hash_end can cause the key string to be reclaimed while the C parser still holds a pointer to it. The subsequent access to the freed string VALUE results in a segfault, confirmed by an RIP pointing to address 0x4242 (a canary-style pattern suggesting control over the freed memory's content). This issue has been fixed in version 3.17.2. This documents upstream package version guidance and does not establish downstream distribution patch state.

Original evidence

Download this source record (JSON)

Open this case in the interactive tracker · Browse all static security cases