CVE-2018-1000164: Gunicorn HTTP response header injection via CRLF

CVE-2018-1000164 · Severity: high · CVSS 7.5 · Published 2018-07-12

Gunicorn is a widely-used Python application server that handles HTTP requests for web applications. This vulnerability allows remote attackers to inject arbitrary HTTP response headers by embedding CRLF sequences in request data. An attacker could exploit this to set malicious headers, potentially leading to cache poisoning, session fixation, XSS attacks, or other header-based exploits without requiring authentication.

Technologies: gunicorn (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2018-1000164 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2018-1000164 being exploited in the wild.
How severe is CVE-2018-1000164?
High severity, with a CVSS score of 7.5, published 12 July 2018.
Which products and versions are affected?
gunicorn (PyPI) < 19.5.0, ECOSYSTEM:introduced=0,fixed=19.5.0.
Is there a fix for CVE-2018-1000164?
Yes. gunicorn (PyPI): upgrade to 19.5.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2018-1000164 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2018-1000164?
Check whether you run gunicorn (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gunicorn (PyPI): upgrade to 19.5.0 or later
    pip install "gunicorn>=19.5.0"

Technical details

The vulnerability is a CRLF injection (CWE-93) in the process_headers function within gunicorn/http/wsgi.py. The vulnerable code fails to neutralize carriage return (\r) and line feed (\n) sequences in HTTP header values, allowing an attacker to inject arbitrary headers by crafting a malicious HTTP request. The attack requires only network access and no authentication or user interaction. An attacker can inject headers to modify response behavior, set cookies, bypass security controls, or perform cache poisoning attacks. The issue was addressed in gunicorn version 19.5.0 and patch commit 1e10a02 in the benoitc/gunicorn repository.

Affected products

  • Gunicorn Gunicorn < 19.5.0

Identifiers

  • CVE-2018-1000164
  • GHSA-32pc-xphx-q4f6
  • PYSEC-2018-55

Timeline

  • 2018-07-12: disclosed
  • 2018: patched: Fixed in version 19.5.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.