CVE-2026-114136

Django REST framework: JSONParser applies an attacker-named codec to the request stream

Published Oct 21, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
Django REST framework is a toolkit for building Web APIs. From 3.6.4 until 3.18.2, JSONParser.parse in rest_framework/parsers.py uses the client-supplied Content-Type charset value with codecs.getreader, which accepts byte-transform codecs such as bz2_codec rather than only text encodings. A remote unauthenticated client can therefore cause a compressed JSON request body to be expanded after Django has enforced DATA_UPLOAD_MAX_MEMORY_SIZE against only the wire bytes, allowing a very small request to consume substantial per-worker memory. The default parser set is sufficient, and any reachable endpoint that accepts a JSON body is affected. This issue is fixed in version 3.18.2.

Analysis

AI-generated

Technical impact

The vulnerability arises because Django REST framework’s JSONParser uses the Content‑Type charset supplied by the client and passes it directly to codecs.getreader. This function accepts byte‑transform codecs, such as bz2_codec, allowing compressed data to be decompressed after the framework has already enforced the DATA_UPLOAD_MAX_MEMORY_SIZE limit on the raw request bytes. A remote unauthenticated client can thus send a very small request that expands to consume a large portion of per‑worker memory. The result is a denial of service that can exhaust worker processes and interrupt service availability. This weakness involves improper validation of input and unchecked use of external codecs.

Affected Systems

The affected product is Django REST framework, a toolkit for building Web APIs. Versions starting at 3.6.4 up to and including 3.18.1 are vulnerable. The vulnerability is fixed by upgrading to version 3.18.2 or later.

Risk and Exploitability

The CVSS score of 7.5 indicates a high severity risk. The EPSS score is not available, but the lack of a known exploit and absence from the CISA KEV catalog suggest that exploitation has not yet been observed. Based on the description, it is inferred that the attacker can send a crafted request from an unauthenticated remote client to any reachable endpoint that accepts a JSON body, potentially leading to memory exhaustion. Efforts to mitigate this risk should focus on patching and restricting content types.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Django REST framework to version 3.18.2 or later.
  • Configure the API to reject any JSON requests that specify a Content‑Type charset not restricted to standard text encodings, thereby preventing compressed codecs from being used.
  • Enable monitoring of worker memory usage and set thresholds to automatically restart or terminate workers that exceed reasonable limits.

Generated by OpenCVE AI on October 22, 2026 at 02:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-3547-9m27-7rxg Django REST framework: JSONParser applies an attacker-named codec to the request stream
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Encode
Encode django Rest Framework
Vendors & Products Encode
Encode django Rest Framework
Type Values Removed Values Added
Description Django REST framework is a toolkit for building Web APIs. From 3.6.4 until 3.18.2, JSONParser.parse in rest_framework/parsers.py uses the client-supplied Content-Type charset value with codecs.getreader, which accepts byte-transform codecs such as bz2_codec rather than only text encodings. A remote unauthenticated client can therefore cause a compressed JSON request body to be expanded after Django has enforced DATA_UPLOAD_MAX_MEMORY_SIZE against only the wire bytes, allowing a very small request to consume substantial per-worker memory. The default parser set is sufficient, and any reachable endpoint that accepts a JSON body is affected. This issue is fixed in version 3.18.2.
Title Django REST framework: JSONParser applies an attacker-named codec to the request stream
Weaknesses CWE-409
CWE-770
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-409

    Improper Handling of Highly Compressed Data (Data Amplification)

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 30, 2026, 7:24 PM
Reserved
Oct 20, 2026, 9:53 PM
Status
Awaiting Analysis
Published
Oct 21, 2026, 8:17 PM
Modified
Oct 30, 2026, 8:16 PM
Severity
Important
Public date
Oct 21, 2026, 8:02 PM