CVE-2026-115274

Unbounded integer parsing in JSON.decode/1 enables CPU and memory exhaustion denial of service in Elixir

Published Oct 30, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
Improper Validation of Specified Quantity in Input vulnerability in the Elixir standard library's JSON module allows an unauthenticated attacker who supplies a JSON document to cause a denial of service through CPU and memory exhaustion.

JSON.decode/1 and JSON.decode!/1 convert each integer literal with erlang:binary_to_integer/1 and do not bound its length. A literal of one million digits decodes successfully but costs 100 to 300 times as much CPU as a string of the same length, so one request body of a few megabytes holds a scheduler for about a second. A literal of more than about 1.29 million digits raises SystemLimitError. Applications generated by phx.new decode request bodies with JSON in Plug.Parsers, before routing and authentication.

This issue affects elixir: from 1.18.0-rc.0 before 1.18.6, from 1.19.0-rc.0 before 1.19.7, and from 1.20.0-rc.0 before 1.20.5.

Analysis

AI-generated

Technical impact

Elixir's core JSON module can parse integer literals of arbitrary length without bounding the size of the digit string. Converting a very long integer consumes 100‑300 times more CPU cycles than parsing a string of equal length, and a literal exceeding approximately 1.29 million digits triggers a SystemLimitError. An unauthenticated attacker can send such a payload in an HTTP request, exhausting a scheduler process for up to a second and potentially disrupting service availability. The weakness is an instance of unbounded resource allocation (CWE-770) and improper quantity validation (CWE-1284).

Affected Systems

The flaw exists in Elixir releases from 1.18.0‑rc.0 up through 1.18.5, from 1.19.0‑rc.0 through 1.19.6, and from 1.20.0‑rc.0 through 1.20.4. Any application that uses Elixir's JSON.decode/1 or JSON.decode!/, especially web frameworks that automatically parse request bodies (e.g., Phoenix), is vulnerable.

Risk and Exploitability

With a CVSS score of 6.9 the vulnerability is of moderate severity, and the EPSS score of < 1% indicates a very low exploitation probability. The vulnerability is not listed in the CISA KEV catalog. The attack vector is likely a simple unauthenticated HTTP POST containing an oversized integer value in the JSON body—a scenario that does not require prior authentication or privileged access. Given that the issue resides in the language core, deploying the fix promptly is essential to reduce the window of exposure.

Remediation

Vendor Workaround

Decode untrusted JSON with an integer decoder that rejects long digit runs before conversion: defmodule SafeJSON do def decode!(binary) do case JSON.decode(binary, :ok, integer: &safe_integer/1) do {decoded, :ok, ""} -> decoded _ -> raise ArgumentError, "invalid JSON" end end defp safe_integer(digits) when byte_size(digits) <= 1024, do: String.to_integer(digits) defp safe_integer(_digits), do: raise(ArgumentError, "integer too long") end In Phoenix, pass SafeJSON to Plug.Parsers as json_decoder instead of Phoenix.json_library().


OpenCVE Recommended Actions

  • Upgrade Elixir to a patched release (≥1.18.6, ≥1.19.7, or ≥1.20.5) to eliminate unbounded integer parsing, thereby mitigating CWE-770 and CWE-1284.
  • Implement the SafeJSON module or similar logic that rejects integer literals longer than 1,024 bytes, and configure Plug.Parsers to use it; this addresses the same CWE weaknesses until an upgrade is possible.
  • Review any custom JSON decoding code to enforce integer size limits or overall input payload size constraints, ensuring compliance with CWE-770 and CWE-1284.

Generated by OpenCVE AI on November 6, 2026 at 02:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-770
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Improper Validation of Specified Quantity in Input vulnerability in the Elixir standard library's JSON module allows an unauthenticated attacker who supplies a JSON document to cause a denial of service through CPU and memory exhaustion. JSON.decode/1 and JSON.decode!/1 convert each integer literal with erlang:binary_to_integer/1 and do not bound its length. A literal of one million digits decodes successfully but costs 100 to 300 times as much CPU as a string of the same length, so one request body of a few megabytes holds a scheduler for about a second. A literal of more than about 1.29 million digits raises SystemLimitError. Applications generated by phx.new decode request bodies with JSON in Plug.Parsers, before routing and authentication. This issue affects elixir: from 1.18.0-rc.0 before 1.18.6, from 1.19.0-rc.0 before 1.19.7, and from 1.20.0-rc.0 before 1.20.5.
Title Unbounded integer parsing in JSON.decode/1 enables CPU and memory exhaustion denial of service in Elixir
First Time appeared Elixir-lang
Elixir-lang elixir
Weaknesses CWE-1284
CPEs cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:*
Vendors & Products Elixir-lang
Elixir-lang elixir
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-1284

    Improper Validation of Specified Quantity in Input

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
EEF
Published
Updated
Nov 20, 2026, 5:59 AM
Reserved
Oct 23, 2026, 12:45 PM
Status
Deferred
Published
Oct 30, 2026, 9:17 AM
Modified
Nov 20, 2026, 6:17 AM
Severity
Moderate
Public date
Oct 30, 2026, 8:57 AM