Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. oj
  4. ›
  5. CVE-2026-54502

CVE-2026-54502: Oj: Stack Buffer Overflow in Oj.dump via Large Indent

June 19, 2026

Oj.dump is vulnerable to a stack-based buffer overflow when a large :indent value is provided by the developer. fill_indent in dump.h calls memset(indent_str, ' ', (size_t)opts->indent) without validating the size. When opts->indent is set to INT_MAX (2,147,483,647), the (size_t) cast preserves the large value and memset writes 2 GB into the stack-allocated out buffer (4,184 bytes), corrupting the stack and crashing the process.

References

  • github.com/advisories/GHSA-3v45-f3vh-wg7m
  • github.com/ohler55/oj/security/advisories/GHSA-3v45-f3vh-wg7m
  • nvd.nist.gov/vuln/detail/CVE-2026-54502

Code Behaviors & Features

Detect and mitigate CVE-2026-54502 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.17.3

Fixed versions

  • 3.17.3

Solution

Upgrade to version 3.17.3 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-121: Stack-based Buffer Overflow

Source file

gem/oj/CVE-2026-54502.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:23:37 +0000.