Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. oj
  4. ›
  5. CVE-2026-54902

CVE-2026-54902: Oj: Use-After-Free in Oj::Parser SAJ Long Key Callback

June 19, 2026

Oj::Parser in SAJ mode does not protect cached object keys (≥ 35 bytes) from garbage collection. 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).

References

  • github.com/advisories/GHSA-m578-w5vf-rfcm
  • github.com/ohler55/oj/security/advisories/GHSA-m578-w5vf-rfcm
  • nvd.nist.gov/vuln/detail/CVE-2026-54902

Code Behaviors & Features

Detect and mitigate CVE-2026-54902 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.17.3

Fixed versions

  • 3.17.3

Solution

Upgrade to version 3.17.3 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-416: Use After Free

Source file

gem/oj/CVE-2026-54902.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:24:11 +0000.