Skip to content
Smuggling / CRLF Disclosed report Advanced CVE-2024-1135

Request smuggling leading to endpoint restriction bypass in Gunicorn

Gunicorn mishandles conflicting Transfer-Encoding headers, treating requests as chunked even when the final encoding is not chunked. An attacker could exploit this to bypass endpoint restrictions and access restricted endpoints.

benoitc/gunicorn

Originally disclosed on huntr

Gunicorn fails to properly validate Transfer-Encoding headers, leading to HTTP Request Smuggling (HRS) vulnerabilities. By crafting requests with conflicting Transfer-Encoding headers, attackers can bypass security restrictions and access restricted endpoints. This issue is due to Gunicorn's handling of Transfer-Encoding headers, where it incorrectly processes requests with multiple, conflicting Transfer-Encoding headers, treating them as chunked regardless of the final encoding specified. This vulnerability has been shown to allow access to endpoints restricted by gunicorn. This issue has been addressed in version 22.0.0.

To be affected users must have a network path which does not filter out invalid requests. These users are advised to block access to restricted endpoints via a firewall or other mechanism if they are unable to update.

From the GitHub Advisory Database (GHSA-w3h3-4rj7-4ph4, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely Gunicorn does not correctly validate multiple conflicting Transfer-Encoding headers and defaults to chunked encoding regardless of the final value.

Impact

An attacker could bypass endpoint restrictions and reach restricted endpoints, but only if the network path does not filter out invalid requests.

What the attacker needed

Network path that does not filter invalid requests

The fix

The issue was fixed in version 22.0.0; users who cannot update should block access to restricted endpoints via a firewall or other mechanism.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a web server and a proxy sit in front of an application, they must agree on where one HTTP request ends and the next begins. If they disagree because of a confusing header, an attacker can sneak a second request past the proxy's checks. Here, Gunicorn misreads a header that says how the request body is encoded, so it can be tricked into treating a request as chunked when it should not.

What is Smuggling / CRLF?

A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.

More from benoitc/gunicorn

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Request smuggling and header injection

The lesson behind this report.

A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.