# CVE-2026-54897: Oj : Use-After-Free in Oj::Doc Iterators via Reentrant Close

- Priority: **Routine**
- Reason: Not severe (CVSS 2.1, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-06-30 · Modified: 2026-07-01
- Aliases: UBUNTU-CVE-2026-54897, DEBIAN-CVE-2026-54897, CGA-26vg-rxwp-c3qc, CGA-46j5-c97w-mqqj, CGA-6mw3-m6vw-5vhh, CGA-74g2-h23q-5f39, CGA-9cx7-c558-86mh, CGA-cx85-p749-3fgw, CGA-fm9p-5pvw-59jc, CGA-gwgr-8r45-f25q, CGA-j45j-jr87-xhmj, CGA-pjg9-jmp9-548f, CGA-qc42-27mf-7pgq, CGA-qmrx-7rr2-q656, CGA-qppq-jrr8-93j3, CGA-rh62-78f7-5j36, CGA-v8vv-ccg6-2fqp, CGA-xgcm-57f5-6cgx, CGA-24rj-ww3f-9475, CGA-25c8-8rm4-g68m, CGA-2f32-qqpw-8v37, CGA-2f79-c5ph-3x4h, CGA-2pcf-g9xr-fmwj, CGA-2w64-vphc-wjm3, CGA-33jp-hxxw-fcfr, CGA-36jc-78h5-x67v, CGA-3h6g-v2f8-2rm6, CGA-3mrx-29xh-3vm5, CGA-424r-587w-wcrh, CGA-4qh5-qmj4-4689, CGA-5f9h-gg84-wp96, CGA-699q-f8jh-cj4w, CGA-6j7m-3f3w-773r, CGA-6vw4-548h-6h3c, CGA-753m-7c5x-w8q9, CGA-87qx-q8gr-wgfc, CGA-8c8x-8p8h-x3pp, CGA-8jqm-mvp3-28v4, CGA-8p4r-mhhp-hf9w, CGA-8r35-qmr4-x2xq, CGA-967p-x3hm-hcfc, CGA-9846-r77c-c4cg, CGA-9q2v-6mh7-24hg, CGA-c4mr-95xp-mp4x, CGA-cgcx-qfvg-8wr4, CGA-cqwv-gff2-94q4, CGA-f8ff-hr8p-gh33, CGA-fh53-4v88-v2rx, CGA-hgh6-gj25-r9rw, CGA-hqw2-hxwc-4pmr, CGA-hvp7-hr98-fq82, CGA-jh96-6g96-9mcj, CGA-p4rf-f5f3-mgrx, GHSA-9ppp-w3g4-fh4q, CGA-pwh7-6jcj-cx62, CGA-q275-jmff-q35p, CGA-qj4h-vvm9-v8gx, CGA-vqpp-43j4-qqpj, CGA-vr4r-pf72-5q4r, CGA-vwcc-3fwr-x634, CGA-w6xp-vcg5-6vrx, CGA-xq82-68w3-52pv, CGA-xrw3-jcrr-348r
- Record: https://cvemate.com/vulnerability/CVE-2026-54897 · JSON: https://cvemate.com/vulnerability/CVE-2026-54897/json

## Description

```text
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.
```

## Signals

- CVSS: 2.1 low (v4.0, CVE.org) 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
- EPSS: 0.203%, percentile 10.848%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 38)

- chainguard gitlab-rails-ce-18.1 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.5 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.6 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.7 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.8 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.9 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.1 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.5 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.6 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.7 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.8 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.9 (Chainguard): All versions (No fix recorded)
- chainguard ruby3.2-fluentd-kubernetes-daemonset-1.16-kinesis (Chainguard): \< 1.16.11.1.0-r3
- chainguard ruby3.2-fluentd-kubernetes-daemonset-1.17-kinesis (Chainguard): \< 1.17.1.1.2-r10
- chainguard ruby3.2-fluentd-kubernetes-daemonset-1.18-kinesis (Chainguard): \< 1.18.0.1.5-r3
- chainguard ruby3.2-fluentd-kubernetes-daemonset-1.19-kinesis (Chainguard): \< 1.19.2.1.1-r5
- chainguard ruby3.2-kube-logging-operator-fluentd-outputs (Chainguard): \< 6.7.0-r4
- chainguard ruby3.3-fluentd-kubernetes-daemonset-1.16-kinesis (Chainguard): \< 1.16.11.1.0-r3
- chainguard ruby3.3-fluentd-kubernetes-daemonset-1.17-kinesis (Chainguard): \< 1.17.1.1.2-r9
- chainguard ruby3.3-fluentd-kubernetes-daemonset-1.18-kinesis (Chainguard): \< 1.18.0.1.5-r4

## References

- <https://github.com/ohler55/oj/security/advisories/GHSA-9ppp-w3g4-fh4q>
- <https://ubuntu.com/security/CVE-2026-54897>
- <https://www.cve.org/CVERecord?id=CVE-2026-54897>
- <https://security-tracker.debian.org/tracker/CVE-2026-54897>
- <https://github.com/ohler55/oj>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-54897>
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/oj/CVE-2026-54897.yml>
- <https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54897>

---

Data as of 2026-12-05T03:43:51.916Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
