Loading0%
SUBZER0
LIVE
Alerts

CVE-2026-114138

Django REST framework: Accept header with many large quoted parameters burns ~19s of CPU per request in content negotiation

Archived. This CVE has left SubZer0's live 30-day window. Signals below are as of 2026-11-21; check the references for anything newer.

  • Severity: High
  • CVSS 7.5
  • EPSS 0.60%
  • Public exploit
  • P2 · This week

Why P2: this week.

Description

### Summary DRF's content negotiation parses each Accept token several times per request and never limits the number of tokens or their total size. Each parse ends up in Django's parse_header_parameters, which takes quadratic time when a quoted parameter value is packed with semicolons. On my machine a single GET with a 780KB Accept header made of 96 such tokens kept one gunicorn worker busy for 18.87 seconds (Django 6.1, djangorestframework 3.18.0, gunicorn 26.0.0, Python 3.13, Docker on macOS). The header is syntactically valid, fits inside gunicorn's default header limits, and needs no authentication. Two concurrent requests, which is one per sync worker, made a default two worker deployment stop answering for my whole 40 second test window. It recovered half a second after I stopped sending. ### Details #### What happens get_accept_list() splits the Accept header on commas with no cap on token count or total size, at rest_framework/negotiation.py:96-97. For every token, select_renderer() calls media_type_matches() once per renderer, and each call builds fresh _MediaType objects for both sides, at rest_framework/negotiation.py:53-56 and rest_framework/utils/mediatypes.py:22-23. `_MediaType.__init__` calls django.utils.http.parse_header_parameters unconditionally, at rest_framework/utils/mediatypes.py:47. When nothing matches, DRF raises NotAcceptable (406). Rendering that error response also needs a renderer, so finalize_response() runs the entire negotiation a sec…

Affected products

  • pip djangorestframework < 3.18.2; first patched: 3.18.2

References

Browse more

PyPI (pip) packagesDjangoWeek 43, 2026 recap

Published 2026-10-21 · sources: GitHub Advisory Database