Ruby JSON has a format string injection vulnerability
Published 19 Mar 2026 · Updated 10 Sept 2026
Is your project on an affected json?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=2.18.0 <2.19.2
- Fixed in
- 2.19.2
bundle update --conservative json # Gemfile: '>= 2.19.2'- Affected
- >=2.16.0 <2.17.1.2
- Fixed in
- 2.17.1.2
bundle update --conservative json # Gemfile: '>= 2.17.1.2'- Affected
- >=2.14.0 <2.15.2.1
- Fixed in
- 2.15.2.1
bundle update --conservative json # Gemfile: '>= 2.15.2.1'Details
Impact
A format string injection vulnerability than that lead to denial of service attacks or information disclosure, when the allow_duplicate_key: false parsing option is used to parse user supplied documents.
This option isn't the default, if you didn't opt-in to use it, you are not impacted.
Patches
Patched in 2.19.2.
Workarounds
The issue can be avoided by not using the allow_duplicate_key: false parsing option.
Is GHSA-3m6g-2423-7cp3 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected json, and gives you the command that fixes it.
More advisories for json
- LowCVE-2026-71847Ruby JSON: JSON::ResumableParser#partial_value dereferences a freed input buffer and crashes on truncated duplicate-key streams · 7 Aug 2026
- LowCVE-2026-54696Ruby json: JSON generator heap buffer overflow when streaming to an IO · 23 Jul 2026
- HighCVE-2025-27788Out-of-bounds Read in Ruby JSON Parser · 12 Mar 2025
- HighCVE-2020-10663Unsafe object creation in json RubyGem · 27 Jul 2020
- HighCVE-2013-0269JSON gem has Improper Input Validation vulnerability · 24 Oct 2017
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.