Skip to content

← Actionable
High, CVSS 7.5

Oj: Stack Buffer Overflow in Oj::Doc#each_child via Deeply Nested Input

CVE-2026-54592GHSA-3m6q-jj5j-38c9

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (oj 3.17.3), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • RubyGems oj

    Affected
    < 3.17.3
    Fixed in
    3.17.3

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
  • CVE-2026-54592: 0.33% estimated exploitation activity in the next 30 days; percentile 25.91 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary Oj::Doc#eachchild, when invoked recursively over a deeply nested JSON document, overflows a fixed-size stack buffer and aborts the process. This is a denial of service reachable from untrusted JSON. Details Two-step chain in ext/oj/fast.c: 1. doceachchild (~line 1501) increments doc-where past the wherepath[MAXSTACK = 100] array with no bounds check, and never restores it (doc-where-- is missing). Calling eachchild recursively from inside the yield block therefore drives doc-where beyond the array. 2. On the next entry (~line 1478) the function copies the path into a stack-local buffer: When the previous recursive call left doc-where past wherepath[100], wlen exceeds MAXSTACK and the memcpy overflows savepath on the C stack. The Oj::Doc parser imposes no JSON nesting-depth limit (it relies on a C-stack pressure check), so deeply nested attacker input reaches this path. Proof of Concept Recursion depth <= 99 iterates normally; depth = 101 aborts. lldb backtrace on the affected…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 1 · created ·

    Published from ghsa record GHSA-3m6q-jj5j-38c9

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-54592

Advisory: Oj: Stack Buffer Overflow in Oj::Doc#each_child via Deeply Nested Input
IDs: CVE-2026-54592, GHSA-3m6q-jj5j-38c9
Record: https://patchnext.com/advisories/cve-2026-54592 (revision 1, source checked 26 Oct 2026, 15:52 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.5)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: oj 3.17.3. A vendor fix does not mean a deployment is fixed.

## Affected components
- RubyGems oj: affected < 3.17.3; fixed in 3.17.3

## Suggested inspection (read-only)
- RubyGems oj: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on oj.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-3m6q-jj5j-38c9 (GitHub-reviewed advisory GHSA-3m6q-jj5j-38c9 lists affected ranges: RubyGems oj >=0 <3.17.3)

Commands are suggestions: review each one before running it.

Loading voting…