Skip to content
DoS Disclosed report Intermediate CVE-2022-32205

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

curl stored every Set-Cookie header a server sent without any limit, so a malicious server could fill the cookie jar with large cookies. Later requests matching those cookies grew past curl's internal request-size threshold and failed with an error, denying service until the cookies expired or were removed.

nyymi Follow

Originally disclosed on HackerOne

Bounty$480 Low View original
  • Fixed in 13 hours
  • Paid in 13 hours
  • Disclosed after 13 hours

Summary by the program

CVE-2022-32205: Set-Cookie denial of service Project curl Security Advisory, June 27th 2022

VULNERABILITY A malicious server can serve excessive amounts of Set-Cookie: headers in a HTTP response to curl and curl stores all of them. A sufficiently large amount of (big) cookies make subsequent HTTP requests to this, or other servers to which the cookies match, create requests that become larger than the threshold that curl uses internally to avoid sending crazy large requests (1048576 bytes) and instead returns an error.

This denial state might remain for as long as the same cookies are kept, match and haven't expired. Due to cookie matching rules, a server on foo.example.com can set cookies that also would match for bar.example.com, making it it possible for a "sister server" to effectively cause a denial of service for a sibling site on the same second level domain using this method.

We are not aware of any exploit of this flaw.

INFO CVE-2022-32205 was introduced in commit ed35d6590e72c23c, shipped in curl 7.71.0 with the introduction of the "dynbuf" internally. Before this change, curl had no limit in how large HTTP request it could generate.

CWE-770: Allocation of Resources Without Limits or Throttling

Severity: Low

AFFECTED VERSIONS Affected versions: curl 7.71.0 to and including 7.83.1 Not affected versions: curl < 7.71.0 and curl >= 7.84.0 libcurl is used by many applications, but not always advertised as such!

THE SOLUTION We introduce several new limits and thresholds for cookies:

Send no more than 150 cookies per request Cap the max length used for an outgoing Cookie: header to 8K Cap the max number of accepted Set-Cookie: header fields to 50 A fix for CVE-2022-32205

RECOMMENDATIONS A - Upgrade curl to version 7.84.0

B - Apply the patch to your local version

C - Do not use cookies

TIMELINE This issue was reported to the curl project on May 13, 2022. We contacted distros@ openwall on June 20.

libcurl 7.84.0 was released on June 27 2022, coordinated with the publication of this advisory.

CREDITS This issue was reported by Harry Sintonen. Patched by Daniel Stenberg.

Thanks a lot!

Security Advisory: https://curl.se/docs/CVE-2022-32205.html

The report

A malicious server can serve excessive amounts of Set-Cookie: headers in a HTTP response to curl and curl stores all of them. A sufficiently large amount of (big) cookies make subsequent HTTP requests to this, or other servers to which the cookies match, create requests that become larger than the threshold that curl uses internally to avoid sending crazy large requests (1048576 bytes) and instead returns an error.

This denial state might remain for as long as the same cookies are kept, match and haven't expired. Due to cookie matching rules, a server on foo.example.com can set cookies that also would match for bar.example.com, making it it possible for a "sister server" to effectively cause a denial of service for a sibling site on the same second level domain using this method.

Impact

Denial of service

The original report as published on HackerOne, by nyymi. 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 placed no limit on the number or size of cookies it accepted and stored, so stored cookies could push outgoing requests past the internal size threshold.

Impact

A malicious or sibling server could cause a denial of service for curl requests to matching hosts, lasting as long as the cookies are kept, match and have not expired; the advisory states no exploit is known.

What the attacker needed

Victim's curl talks to a malicious server; cookies match the target host; cookies not expired or removed

The fix

The fix was to add limits: at most 150 cookies sent per request, an outgoing Cookie header capped at 8K, and at most 50 accepted Set-Cookie header fields, shipped in curl 7.84.0.

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 website replies, it can ask the client to remember small pieces of data called cookies, which are sent back on later requests. curl kept every cookie it was given with no cap, so a hostile server could hand over so many large cookies that later requests became too big and curl refused to send them. The result is that the affected site stops working for that user until the cookies go away.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by nyymi

View all

51 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.