Use-After-Free in oj (CVE-2026-54899)
Summary
Vulnerability in oj (CVE-2026-54899). Risk of unauthorized operations or information disclosure. Exploitable via symbol_keys. Mitigation: upgrade to 3.17.2 or later.
Original description
The description as published by the source.
Summary
Disabling symbol_keys on a reused Oj::Parser instance triggers a heap use-after-free. When symbol_keys is toggled from true to false, opt_symbol_keys_set frees the internal key cache (cache_free) but does not clear the pointer. The next parse call reads from the freed cache via cache_intern, producing a use-after-free.
Version
- Software: oj gem
- Affected: all versions with
ext/oj/usual.c - Latest tested: 3.17.1 (confirmed present)
Details
ext/oj/usual.c, opt_symbol_keys_set:
// usual.c:1043–1051
if (symbol_keys) {
d->key_cache = cache_create(...); // allocate
} else {
cache_free(d->key_cache); // free — but d->key_cache pointer not NULLed
}
On the next parse call, cache_key → cache_intern reads from d->key_cache which now points to freed memory.
ASAN report:
==145265==ERROR: AddressSanitizer: heap-use-after-free on address 0x50b00001a318
READ of size 8 at 0x50b00001a318 thread T0
#0 cache_intern /ext/oj/cache.c:328
#1 cache_key /ext/oj/usual.c:161
#2 close_object /ext/oj/usual.c:285
#3 parse /ext/oj/parser.c:693
#4 parser_parse /ext/oj/parser.c:1408
freed by thread T0 here:
#0 free
#1 cache_free /ext/oj/cache.c:277
#2 opt_symbol_keys_set /ext/oj/usual.c:1051
#3 option /ext/oj/usual.c:1111
#4 parser_missing /ext/oj/parser.c:1362…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-54899 has been found in oj.
Attackers can target a specific entry point like symbol_keys over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade oj to 3.17.2 or later.
If unsure, ask your IT team or search "oj CVE-2026-54899" on the vendor's site.
CVE-2026-54899 (oj) — CWE-416
Attack surface: symbol_keys / true / false / opt_symbol_keys_set
Patched: 3.17.2 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Use-after-free (CWE-416) exists in oj. Attackers reach the vulnerable code path via symbol_keys.
Check the vendor advisory for the affected versions of oj. Attack surface: symbol_keys / true / false / opt_symbol_keys_set.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 3.17.2.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'oj' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'oj' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
ojを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade oj to 3.17.2ステージング環境で 3.17.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-54899 ruby-oj Fixed in: 3.14.2-1+deb12u1
- Ubuntu UBUNTU-CVE-2026-54899 ruby-oj
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web cve.org