Skip to content
Smuggling / CRLF Disclosed report Intermediate CVE-2019-16276CVE-2020-11946

HTTP Request Smuggling Vulnerability Analysis - cURL Security Report

cURL does not reject HTTP requests that contain both Transfer-Encoding and Content-Length headers, so both headers are sent. When such a request passes through an intermediary that interprets the headers differently from the destination server, an attacker could smuggle a second request past security controls or poison a cache.

youssef111 Follow

Originally disclosed on HackerOne

  • Disclosed after under an hour

HTTP Request Smuggling Vulnerability Report - cURL

Summary:

cURL does not explicitly reject HTTP requests that contain both Transfer-Encoding and Content-Length headers, which can lead to HTTP request smuggling vulnerabilities (CWE-444) when the request passes through intermediary systems (proxies, load balancers, firewalls) that interpret these conflicting headers differently than the destination server. This inconsistent interpretation allows attackers to potentially smuggle malicious requests past security controls or cause cache poisoning attacks.

The vulnerability stems from the http_req_set_reader() function in http.c which processes Transfer-Encoding headers without validating for the presence of conflicting Content-Length headers. While cURL internally prioritizes Transfer-Encoding over Content-Length when both are present, it does not remove or reject the conflicting Content-Length header, allowing both headers to be sent in the same request.

Note: This vulnerability analysis was conducted through manual code review of the cURL source code. AI assistance was used to help structure and format this vulnerability report.

Affected version

This vulnerability affects cURL versions that include the current HTTP request handling implementation. Testing was performed on:

  • cURL Version: 8.4.0 (curl-master branch)
  • Platform: Windows 10, Linux Ubuntu 20.04
  • libcurl Version: 8.4.0
  • Protocols: HTTP/1.1, HTTP/2
  • Features: SSL, chunked transfer encoding

To check your version, run:

Bash
curl -V

Steps To Reproduce:

  1. Create a test HTTP request with conflicting headers:

    Bash
    curl -v -X POST \
      -H "Transfer-Encoding: chunked" \
      -H "Content-Length: 100" \
      -d "0\r\n\r\nSMUGGLED_PAYLOAD" \
      http://example.com/test
    
  2. Observe that cURL sends both headers without rejection:

    • Monitor the actual HTTP request using -v flag
    • Confirm both Transfer-Encoding: chunked and Content-Length: 100 headers are present
    • Note that cURL processes the request using chunked encoding while keeping the Content-Length header
  3. Test with a proxy setup to demonstrate smuggling potential:

    Bash
    # Setup a test proxy that interprets Content-Length first
    # Then send the conflicting headers through the proxy
    curl -v --proxy http://test-proxy:8080 \
      -H "Transfer-Encoding: chunked" \
      -H "Content-Length: 50" \
      -X POST \
      -d "0\r\n\r\nPOST /admin HTTP/1.1\r\nHost: target.com\r\n\r\n" \
      http://target.com/public
    
  4. Reproduce using Python script for automated testing:

    Python
    import subprocess
    
    def test_smuggling():
        cmd = [
            "curl", "-v", "--include",
            "-H", "Transfer-Encoding: chunked",
            "-H", "Content-Length: 200",
            "-X", "POST",
            "-d", "0\r\n\r\nGET /smuggled HTTP/1.1\r\nHost: example.com\r\n\r\n",
            "http://example.com/endpoint"
        ]
    
        result = subprocess.run(cmd, capture_output=True, text=True)
        print("STDOUT:", result.stdout)
        print("STDERR:", result.stderr)
    
    test_smuggling()
    
  5. Verify the vulnerability by checking HTTP traffic:

    • Use Wireshark or similar tool to capture the actual HTTP request
    • Confirm that both conflicting headers are present in the wire protocol
    • Test the same request against different servers/proxies to observe varying interpretations

Supporting Material/References:

  • Source Code Analysis: Review of http.c - http_req_set_reader() function and http_req_complete() function
  • CWE Classification: CWE-444 - Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
  • CVSS Score: 6.5 (Medium) - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
  • Proof of Concept Script: Python script demonstrating the vulnerability (included in steps above)
  • Network Traffic Capture: Wireshark/tcpdump capture showing both headers in the same request
  • RFC References:
    • RFC 7230 Section 3.3.3 (Message Body Length)
    • RFC 7230 Section 3.3.1 (Transfer-Encoding)
  • Similar CVEs:
    • CVE-2019-16276 (Node.js HTTP request smuggling)
    • CVE-2020-11946 (HTTP request smuggling in various web servers)
  • Security Research: James Kettle's "HTTP Desync Attacks: Request Smuggling Reborn" whitepaper
  • Test Environment: Docker containers with different proxy configurations for testing header interpretation differences

Impact

An attacker can achieve several significant security impacts by exploiting this HTTP request smuggling vulnerability:

1. Authentication Bypass

  • Smuggle requests to protected endpoints by bypassing authentication mechanisms
  • Access administrative interfaces or sensitive APIs without proper credentials
  • Escalate privileges by routing requests through different authentication contexts

2. Cache Poisoning

  • Poison web caches and CDNs by associating malicious content with legitimate URLs
  • Serve malicious content to subsequent users requesting cached resources
  • Manipulate cached responses to inject malicious scripts or redirect users

3. Request Hijacking

  • Intercept and modify other users' requests in shared proxy environments
  • Steal sensitive data from requests of other users sharing the same connection
  • Manipulate session tokens and authentication credentials

4. Firewall and Security Control Bypass

  • Circumvent Web Application Firewalls (WAFs) by hiding malicious payloads in smuggled requests
  • Bypass rate limiting and access controls implemented by intermediary devices
  • Evade security monitoring and logging systems

5. Session Hijacking

  • Manipulate session management by smuggling requests that appear to come from legitimate users
  • Hijack user sessions by intercepting authentication tokens
  • Perform unauthorized actions on behalf of legitimate users

6. Data Exfiltration

  • Access sensitive data by smuggling requests to internal APIs or databases
  • Bypass data loss prevention (DLP) systems
  • Extract confidential information through carefully crafted smuggled requests

7. Cross-Site Scripting (XSS) and Injection Attacks

  • Inject malicious scripts into responses through cache poisoning
  • Perform SQL injection attacks by smuggling database queries
  • Execute stored XSS attacks by poisoning cached content

Impact Severity: Medium to High depending on the network architecture and security controls in place. The vulnerability is particularly dangerous in environments with multiple proxy layers, CDNs, or shared hosting infrastructures.

The original report as published on HackerOne, by youssef111. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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, cURL's HTTP request handling does not remove or reject a Content-Length header when a Transfer-Encoding header is also present, so both are sent even though cURL itself uses chunked encoding.

Impact

An attacker could potentially bypass authentication, poison caches, hijack requests or sessions, evade firewalls, exfiltrate data, or inject scripts, but only when an intermediary interprets the conflicting headers differently from the destination server.

What the attacker needed

CURL sends both headers; an intermediary proxy or load balancer; intermediary and server disagree on headers

The fix

cURL could reject or remove the Content-Length header when Transfer-Encoding is present, or refuse conflicting headers.

How it was found

  1. Create a request with both Transfer-Encoding: chunked and Content-Length headers.
  2. Observe with verbose output that cURL sends both headers without rejection.
  3. Send the conflicting headers through a test proxy that interprets Content-Length first.
  4. Use a Python script to automate sending the conflicting headers.
  5. Capture the HTTP traffic to confirm both headers are present on the wire.

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.

HTTP request smuggling happens when two systems disagree about where one HTTP request ends and the next begins. Here, cURL sends two headers that both describe the request body length, and a proxy might trust one while the server trusts the other. That mismatch can let an attacker hide a second request inside the first.

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 curl

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.