Out-of-bounds ReadWeakness · CWE-125

CVE-2026-54500

MEDIUM · 5.3 CVSS v3.1 Published 2026-07-01
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
62/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click 7 weeks old

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.3, Oj.load in :object mode reads uninitialized stack memory (and, for long keys, reads out of bounds) when parsing a JSON object whose key is 254 bytes or longer. The interned bytes can surface to the caller, disclosing process stack memory. In ext/oj/intern.c, form_attr() handles the long-key path by allocating a heap buffer, `b`, populating it with the attribute name, and then freeing it — but it passed the uninitialized stack buffer buf (not b) to rb_intern3(). rb_intern3 therefore reads len + 1 bytes of uninitialized stack memory. When the key length is >= 256, it also reads out of bounds past the 256-byte buf. The resulting bytes are interned and can reach the caller via the produced Symbol or via the EncodingError message raised on invalid UTF-8, leaking process stack contents. This issue has been fixed in version 3.17.3.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

In Oj Ruby gem versions prior to 3.17.3, the form_attr() function in ext/oj/intern.c has a memory handling bug when parsing JSON objects with keys >=254 bytes. It allocates a heap buffer for the attribute name but incorrectly passes an uninitialized 256-byte stack buffer (buf) to rb_intern3() instead of the heap buffer (b). This causes rb_intern3 to read len+1 bytes of uninitialized stack memory, and for keys >=256 bytes, reads out-of-bounds past buf. The leaked bytes become interned in Ruby Symbols and can be disclosed via those Symbols or EncodingError messages from invalid UTF-8, revealing process stack contents.

MitigationUpgrade Oj gem to version 3.17.3 or later. If upgrade is not immediately possible, avoid using Oj.load with :object mode on untrusted JSON input containing long keys.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

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

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check if Oj gem is installed
    Run `gem list oj` or inspect your Gemfile.lock for the oj gem entry
    Affected if The gem is present and the version listed is below 3.17.3 (e.g., 3.17.2, 3.16.0, etc.)
  2. Identify Oj version in use
    Execute `ruby -e "require 'oj'; puts Oj::VERSION"` to print the loaded gem version
    Affected if The reported version is any version prior to 3.17.3
  3. Verify Oj.load usage with object mode
    Search your codebase for patterns like `Oj.load(..., mode: :object)` or `Oj.load(..., :object)` indicating object mode parsing
    Affected if Your application calls Oj.load with :object mode enabled on JSON data from untrusted sources
  4. Inspect JSON input for long keys
    If you log or can inspect processed JSON, check if any object keys are 254 bytes or longer
    Affected if Your application processes JSON objects containing keys >=254 bytes in length
  5. Check for Symbol creation from JSON parsing
    Monitor Ruby's Symbol table using `Symbol.all_symbols` after Oj.load operations, or review logs for Symbol creation events
    Affected if Symbols are being interned from parsed JSON keys, especially after loading JSON with long attribute names

You are affected if you are running any Oj gem version prior to 3.17.3 and use Oj.load with object mode on JSON input containing keys of 254 bytes or more.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade Oj gem to version 3.17.3 or later. If upgrade is not immediately possible, avoid using Oj.load with :object mode on untrusted JSON input containing long keys.

Recommended fix High confidence

Oj gem version 3.17.3

  1. Check current Oj gem version with `gem list oj`
  2. Update the Oj gem to version 3.17.3 or later using `gem install oj -v '>= 3.17.3'`
  3. If using Bundler, update Gemfile to specify `gem 'oj', '>= 3.17.3'` and run `bundle update oj`
  4. Verify the fix by testing JSON parsing with keys >= 254 bytes in :object mode to confirm no uninitialized memory is read

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation4.0 h
  • Implementation2.0 h
  • Testing6.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,420
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,872.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-54500 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-54500 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data