# CVE-2013-0269: JSON gem has Improper Input Validation vulnerability

> Remote attackers can cause denial of service or bypass mass assignment protection in Ruby applications via crafted JSON documents.

- **Severity:** High 7.5 (`AV:N/AC:L/Au:N/C:P/I:P/A:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Feb 2013
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2013-0269, DLA-215-1, GHSA-x457-cw4h-hq5f

## What is CVE-2013-0269?

CVE-2013-0269 is a high-severity denial of service vulnerability in n/a, published on 13 Feb 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The JSON gem before 1.5.5, 1.6.x before 1.6.8, and 1.7.x before 1.7.7 for Ruby allows remote attackers to cause a denial of service (resource consumption) or bypass the mass assignment protection mechanism via a crafted JSON document that triggers the creation of arbitrary Ruby symbols or certain internal objects, as demonstrated by conducting a SQL injection attack against Ruby on Rails, aka "Unsafe Object Creation Vulnerability."

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2013-0269?

6 open source packages ship an affected version, including json. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `json` | RubyGems | All versions | 1.5.5 |
| `json` | RubyGems | All versions | 1.5.5 |
| `json` | RubyGems | From 1.6.0 | 1.6.8 |
| `json` | RubyGems | From 1.6.0 | 1.6.8 |
| `json` | RubyGems | From 1.7.0 | 1.7.7 |
| `json` | RubyGems | From 1.7.0 | 1.7.7 |

Products: Rubygems Json Gem.

## How do I fix CVE-2013-0269?

Upgrade json to a fixed version for your release line: 1.5.5, 1.6.8 or 1.7.7.

## Is CVE-2013-0269 being exploited?

There is no known exploitation of CVE-2013-0269 in the wild and no public exploit code.

Public exploit code:

- Inspect all of your Heroku apps for vulnerable versions of the JSON gem (github_poc): https://github.com/heroku/heroku-CVE-2013-0269

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-0269 and fix it if it is affected.

What it is: CVE-2013-0269 is a high-severity denial of service vulnerability in n/a, published on 13 Feb 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2013-0269 in the wild and no public exploit code.

Affected packages and fixed versions:
- json (RubyGems): affected all versions; fixed in 1.5.5
- json (RubyGems): affected all versions; fixed in 1.5.5
- json (RubyGems): affected from 1.6.0; fixed in 1.6.8
- json (RubyGems): affected from 1.6.0; fixed in 1.6.8
- json (RubyGems): affected from 1.7.0; fixed in 1.7.7
- json (RubyGems): affected from 1.7.0; fixed in 1.7.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2013-0269/ (Markdown: https://insights.sbomify.com/CVE-2013-0269/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2013-0269
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2013-0269
- OSV: https://osv.dev/vulnerability/CVE-2013-0269

---
From sbomify Insights: https://insights.sbomify.com/CVE-2013-0269/
Summaries are generated and may contain mistakes; the official description above is the record.
