Vulnérabilité dans oj (CVE-2026-54896)
Résumé
Vulnérabilité dans oj (CVE-2026-54896). Risque d'opérations non autorisées ou de divulgation. Exploitable via Oj.dump. Atténuation : mise à jour vers 3.17.3 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Summary
Oj.dump in object mode is vulnerable to a heap buffer overflow when serializing Exception objects with a large :indent value. The serializer allocates a buffer sized for the object's attributes but does not account for the indent bytes added on each write. With indent: 5000, the accumulation of 5,000-byte indent strings overflows the 13,150-byte heap allocation, corrupting adjacent heap memory.
Version
- Software: oj gem
- Affected: all versions with
ext/oj/dump.h - Latest tested: 3.17.1 (confirmed present)
Details
ext/oj/dump.h, line 75–77:
static void fill_indent(Out out, int depth) {
if (0 < out->opts->indent) {
memset(out->buf + out->cur, ' ', (size_t)(out->opts->indent * depth));
When dumping an Exception object in :object mode, dump_obj_attrs calls fill_indent repeatedly for each attribute. The buffer is pre-allocated based on the serialized content but not the indentation overhead. With indent: 5000 the indent block for a nested object exceeds the remaining buffer space, producing a heap-buffer-overflow of size 5,000 at the end of the allocated region.
ASAN report:
==101656==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x527000022c5e
WRITE of size 5000 at 0x527000022c5e thread T0
#0 memset
#1 fill_indent /ext/oj/dump.h:77
#2 dump_obj_attrs /ext/oj/dump_object.c:552
#3 dump_obj /ext/oj/dump_object.c:80
#4 oj_dump_obj_val /ext/oj/dump_obj…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-54896 a été découverte dans oj.
Des attaquants peuvent cibler un point d'entrée spécifique comme Oj.dump à distance pour détourner le produit.
Risque d'opérations non autorisées ou de divulgation.
Action : mettez à jour oj vers 3.17.3 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « oj CVE-2026-54896 » sur le site de l'éditeur.
CVE-2026-54896 (oj) — CWE-122
Surface d'attaque : Oj.dump / dump_obj_attrs / fill_indent
Correctif : 3.17.3 — appliquer immédiatement
Contournement : This is at the discretion of the developer and not a public facing option so the workaround is the develop should not use extreme indents and should not offer the option for users to dump Ruby data with unlimited indentation size.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-122) affecte oj. Les attaquants atteignent le code vulnérable via Oj.dump.
Consultez l'avis de l'éditeur pour les versions affectées de oj. Surface d'attaque : Oj.dump / dump_obj_attrs / fill_indent.
Gravité : ?. Risque d'opérations non autorisées ou de divulgation.
Mettre à jour vers 3.17.3.
Contournement : This is at the discretion of the developer and not a public facing option so the workaround is the develop should not use extreme indents and should not offer the option for users to dump Ruby data with unlimited indentation size.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'oj' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
ojを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
This is at the discretion of the developer and not a public facing option so the workaround is the develop should not use extreme indents and should not offer the option for users to dump Ruby data with unlimited indentation size.パッチが適用されるまでの応急処置として、This is at the discretion of the developer and not a public facing option so the workaround is the develop should not use extreme indents and should not offer the option for users to dump Ruby data with unlimited indentation size. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3Apply patch patch
Upgrade oj to 3.17.3ステージング環境で 3.17.3 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
État des correctifs par distribution
Paquets corrigés publiés par chaque distribution pour cette CVE
- Debian DEBIAN-CVE-2026-54896 ruby-oj Corrigé dans: 3.14.2-1+deb12u1
- Ubuntu UBUNTU-CVE-2026-54896 ruby-oj
Références
- package github.com
- web github.com
- web github.com