5.3
Medium
oj

CVE-2026-54500

CVE-2026-54500 is a medium-severity out-of-bounds read vulnerability in oj (rubygems), affecting versions < 3.17.3. It is fixed in 3.17.3.

Key facts
CVSS score
5.3
Medium
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
oj
Fixed in
3.17.3
Disclosed
2026

Summary

Summary 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. Details In ext/oj/intern.c, formattr() 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 rbintern3(): rbintern3 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 (CWE-125). 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 is the same defect previously fixed in ext/oj/usual.c; intern.c held a duplicated copy of formattr that was missed. Proof of Concept On affected versions this raises an EncodingError whose message contains ~1500 bytes of uninitialized stack memory (not the supplied "A"s). The leaked byte count varies between runs with the identical payload (e.g. 1491 vs 1516 bytes), confirming the content is uninitialized memory rather than fixed data. Impact Information disclosure of process stack memory to a caller that parses untrusted JSON with Oj.load(..., mode: :object). For keys >= 256 bytes it is also an out-of-bounds read (CWE-125). Severity is bounded by several preconditions: it requires :object mode (which is already discouraged for untrusted input), the leaked bytes are uncontrolled (the attacker cannot choose what is disclosed), and the data only reaches an attacker if the application surfaces the resulting Symbol or EncodingError back to them. Scored CVSS 5.3 (Medium) on that basis. Patches Fixed in 3.17.3: formattr() now passes b to rbintern3 (a one-character change mirroring the earlier usual.c fix). Verified on the fixed build: the same payload returns cleanly with no leak across repeated runs. Credit Reported by Zac Wang (@7a6163).

Impact

What is out-of-bounds read?

A read operation accesses a memory location beyond the intended buffer boundary. Typical impact: sensitive data disclosure or crash.

Severity and exposure

CVE-2026-54500 has a CVSS score of 5.3 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (3.17.3). Upgrading removes the vulnerable code path.

Affected versions

rubygems

  • oj (< 3.17.3)

Security releases

  • oj → 3.17.3 (rubygems)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2026-54500 is reachable in your applications. Explore open-source security for your team.

See if CVE-2026-54500 is reachable in your applications. Get a demo

Remediation advice

Upgrade oj to 3.17.3 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2026-54500

What is CVE-2026-54500?

CVE-2026-54500 is a medium-severity out-of-bounds read vulnerability in oj (rubygems), affecting versions < 3.17.3. It is fixed in 3.17.3. A read operation accesses a memory location beyond the intended buffer boundary.

How severe is CVE-2026-54500?

CVE-2026-54500 has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of oj are affected by CVE-2026-54500?

oj (rubygems) versions < 3.17.3 is affected.

Is there a fix for CVE-2026-54500?

Yes. CVE-2026-54500 is fixed in 3.17.3. Upgrade to this version or later.

Is CVE-2026-54500 exploitable, and should I be worried?

Whether CVE-2026-54500 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2026-54500 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2026-54500?

Upgrade oj to 3.17.3 or later.

Stop the waste.
Protect your environment with Kodem.