Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-114138 Overview
CVE-2026-114138 is a denial of service vulnerability in Django REST framework (DRF) versions prior to 3.18.2. The flaw resides in DefaultContentNegotiation.get_accept_list within rest_framework/negotiation.py, which accepts an unbounded number and aggregate size of Accept header tokens. The select_renderer function repeatedly invokes _MediaType parsing from rest_framework/utils/mediatypes.py for every attacker-controlled token, every renderer, and each forced 406 renegotiation. A remote unauthenticated attacker can trigger disproportionate CPU consumption by submitting crafted Accept headers. The vulnerability is tracked under [CWE-400] Uncontrolled Resource Consumption.
Critical Impact
Unauthenticated remote attackers can pin synchronous workers and make any DRF-backed endpoint unavailable through crafted Accept headers.
Affected Products
- Django REST framework versions prior to 3.18.2
- Web APIs built on vulnerable DRF releases using DefaultContentNegotiation
- Synchronous WSGI deployments serving DRF endpoints
Discovery Timeline
- 2026-10-21 - CVE-2026-114138 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-114138
Vulnerability Analysis
The vulnerability stems from how DRF processes HTTP Accept headers during content negotiation. DefaultContentNegotiation.get_accept_list splits the client-supplied header into media type tokens without enforcing a maximum count or aggregate length. select_renderer then iterates every token against every configured renderer, invoking the _MediaType parser repeatedly. Each parse call delegates to Django's parse_header_parameters, which processes quoted parameter values and semicolon-delimited segments. Attackers submit many distinct media types carrying large quoted parameter values with numerous semicolons. The repeated parsing structure compounds the cost, and a forced 406 renegotiation path runs the same work again. The result is CPU exhaustion that blocks synchronous workers servicing other requests.
Root Cause
The root cause is missing input bounds on the Accept header combined with an O(tokens × renderers) parsing structure. The parser trusts remote input and performs expensive quoted-parameter decoding per token, per renderer, per renegotiation attempt.
Attack Vector
A remote unauthenticated client sends an HTTP request to any reachable DRF endpoint with a crafted Accept header. The header contains many media type tokens, each with large quoted parameters and numerous semicolons. Concurrent requests multiply the effect and sustain the denial of service until requests stop.
# Patch excerpt - rest_framework/request.py
from rest_framework import exceptions
from rest_framework.settings import api_settings
MAX_MEDIA_TYPE_LENGTH = 256
def is_form_media_type(media_type):
"""
Return True if the media type is a valid form media type.
"""
if media_type is None or len(media_type) > MAX_MEDIA_TYPE_LENGTH:
return False
base_media_type, params = parse_header_parameters(media_type)
return (base_media_type == 'application/x-www-form-urlencoded' or
base_media_type == 'multipart/form-data')
Source: GitHub Commit 148ab65
The fix introduces a MAX_MEDIA_TYPE_LENGTH constant of 256 bytes and short-circuits oversized media types. A companion change in negotiation.py replaces order_by_precedence with order_parsed_by_precedence to avoid redundant re-parsing.
Detection Methods for CVE-2026-114138
Indicators of Compromise
- HTTP requests containing Accept headers longer than several kilobytes or with dozens of comma-separated media types
- Accept values containing large quoted parameters and dense semicolon sequences such as type/subtype;a="...";b="...";c="..."
- Spikes in 406 Not Acceptable responses correlated with sustained worker CPU saturation
- Synchronous WSGI workers stuck processing single requests for seconds or longer
Detection Strategies
- Instrument reverse proxies or WAFs to log Accept header length and token count per request
- Alert when any request processing time on DRF endpoints exceeds baseline latency by a defined threshold
- Correlate repeated large-header requests from a single source IP within short time windows
Monitoring Recommendations
- Track per-worker CPU time and request duration histograms for API endpoints
- Monitor Django and WSGI server logs for request queue backups and worker starvation
- Record source IP, user agent, and Accept header size for anomaly analysis in a centralized log store
How to Mitigate CVE-2026-114138
Immediate Actions Required
- Upgrade Django REST framework to version 3.18.2 or later on all affected deployments
- Enforce a maximum request header size at the reverse proxy or load balancer layer
- Rate limit unauthenticated requests to DRF endpoints by source IP
- Review DRF logs for prior exploitation attempts matching the IOC patterns above
Patch Information
The fix is available in Django REST Framework Release 3.18.2. The patch introduces a MAX_MEDIA_TYPE_LENGTH bound and replaces redundant parsing with order_parsed_by_precedence. See the GitHub Security Advisory GHSA-33wh-fxxf-88vv for full details and the upstream commit.
Workarounds
- Cap Accept header length at the edge, for example 256 bytes per media type and 4096 bytes total
- Deploy a custom content negotiation class that rejects requests with excessive media type tokens
- Prefer asynchronous workers or add worker concurrency to reduce the impact of blocked synchronous workers
# Example nginx configuration to limit header size and reject oversized Accept headers
http {
large_client_header_buffers 4 4k;
client_header_buffer_size 1k;
map $http_accept $accept_too_long {
default 0;
"~^.{4097,}$" 1;
}
server {
listen 443 ssl;
if ($accept_too_long) {
return 400;
}
location /api/ {
limit_req zone=api_zone burst=20 nodelay;
proxy_pass http://drf_backend;
}
}
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

