=================================================================== CERT-Renater Note d'Information No. 2022/VULN215 _____________________________________________________________________ DATE : 28/06/2022 HARDWARE PLATFORM(S): / OPERATING SYSTEM(S): Systems running curl versions prior to 7.84.0. ====================================================================https://curl.se/docs/CVE-2022-32205.html https://curl.se/docs/CVE-2022-32206.html https://curl.se/docs/CVE-2022-32207.html https://curl.se/docs/CVE-2022-32208.html _____________________________________________________________________ CVE-2022-32205: Set-Cookie denial of service ==========================================´Project curl Security Advisory, June 27th 2022 - [Permalink](https://curl.se/docs/CVE-2022-32205.html) VULNERABILITY -------------https://curl.se/docs/CVE-2022-32207.html 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](https://github.com/curl/curl/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](https://github.com/curl/curl/commit/48d7064a49148f0394) 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@...nwall 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! / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html _____________________________________________________________________ CVE-2022-32206: HTTP compression denial of service ================================================Project curl Security Advisory, June 27th 2022 - [Permalink](https://curl.se/docs/CVE-2022-32206.html) VULNERABILITY ------------- curl supports "chained" HTTP compression algorithms, meaning that a server response can be compressed multiple times and potentially with different algorithms. The number of acceptable "links" in this "decompression chain" was unbounded, allowing a malicious server to insert a virtually unlimited number of compression steps. The use of such a decompression chain could result in a "malloc bomb", making curl end up spending enormous amounts of allocated heap memory, or trying to and returning out of memory errors. We are not aware of any exploit of this flaw. INFO ---- CVE-2022-32206 was introduced in [commit dbcced8e32b50c06](https://github.com/curl/curl/commit/dbcced8e32b50c06), shipped in curl 7.57.0. Automatic decompression of content needs to be enabled per transfer. It is disabled by default and then nothing bad happens. This flaw exists with just one of the compression algorithms built-in (gzip, brotli or zstd), but the individual algorithms has different "exploding" powers. Both `Content-Encoding:` and `Transfer-Encoding:` are affected. The vulnerability is more emphasized over HTTP/1 than HTTP/2 due to different curl internal header limits. CWE-770: Allocation of Resources Without Limits or Throttling Severity: Medium AFFECTED VERSIONS ----------------- - Affected versions: curl 7.57.0 to and including 7.83.1 - Not affected versions: curl < 7.57.0 and curl >= 7.84.0 libcurl is used by many applications, but not always advertised as such! THE SOLUTION ------------ The amount of accepted "chained" algorithms is now capped to 5. A [fix for CVE-2022-32206](https://github.com/curl/curl/commit/3a09fbb7f264c67c43) RECOMMENDATIONS -------------- A - Upgrade curl to version 7.84.0 B - Apply the patch to your local version C - Do not enable automatic decompression TIMELINE -------- This issue was reported to the curl project on May 15, 2022. We contacted distros@...nwall 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! / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html _____________________________________________________________________ CVE-2022-32207: Unpreserved file permissions ==========================================Project curl Security Advisory, June 27th 2022 - [Permalink](https://curl.se/docs/CVE-2022-32207.html) VULNERABILITY ------------- When curl saves cookies, alt-svc and hsts data to local files, it makes the operation atomic by finalizing the operation with a rename from a temporary name to the final target file name. In that rename operation, it might accidentally *widen* the permissions for the target file, leaving the updated file accessible to more users than intended. We are not aware of any exploit of this flaw. INFO ---- CVE-2022-32207 was introduced in [commit b834890a3fa3f52](https://github.com/curl/curl/commit/b834890a3fa3f52), shipped in curl 7.69.0. This problem can be worked-around by using a strict umask. CWE-281: Improper Preservation of Permissions Severity: Medium AFFECTED VERSIONS ----------------- - Affected versions: curl 7.69.0 to and including 7.83.1 - Not affected versions: curl < 7.69.0 and curl >= 7.84.0 libcurl is used by many applications, but not always advertised as such! THE SOLUTION ------------ A [fix for CVE-2022-32207](https://github.com/curl/curl/commit/20f9dd6bae50b) RECOMMENDATIONS -------------- A - Upgrade curl to version 7.84.0 B - Apply the patch to your local version C - Make extra precautions to protect saved files (ie strict umask) TIMELINE -------- This issue was reported to the curl project on May 17, 2022. We contacted distros@...nwall 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! / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html _____________________________________________________________________ CVE-2022-32208: FTP-KRB bad message verification ==============================================Project curl Security Advisory, June 27th 2022 - [Permalink](https://curl.se/docs/CVE-2022-32208.html) VULNERABILITY ------------- When curl does FTP transfers secured by krb5, it handles message verification failures wrongly. This flaw makes it possible for a Man-In-The-Middle attack to go unnoticed and even allows it to inject data to the client. We are not aware of any exploit of this flaw. INFO ---- CVE-2022-32208 was introduced in [commit 54967d2a3a](https://github.com/curl/curl/commit/54967d2a3a), shipped in curl 7.16.4. This flaw typically makes curl insert `599 ` (+ terminating null) into the data where it detects the error, then the attackers data. It forces the attacker to be somewhat creative to handle this initial hard-coded 5 byte sequence of "junk". FTP-KRB is a rarely used feature. CWE-924: Improper Enforcement of Message Integrity During Transmission in a Communication Channel Severity: Low AFFECTED VERSIONS ----------------- - Affected versions: curl 7.16.4 to and including 7.83.1 - Not affected versions: curl < 7.16.4 and curl >= 7.84.0 libcurl is used by many applications, but not always advertised as such! THE SOLUTION ------------ A [fix for CVE-2022-32208](https://github.com/curl/curl/commit/6ecdf5136b52af7) RECOMMENDATIONS -------------- A - Upgrade curl to version 7.84.0 B - Apply the patch to your local version C - Do not use KRB-FTP TIMELINE -------- This issue was reported to the curl project on June 2, 2022. We contacted distros@...nwall 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! / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html ========================================================+ CERT-RENATER | tel : 01-53-94-20-44 + + 23/25 Rue Daviel | fax : 01-53-94-20-41 + + 75013 Paris | email:cert@support.renater.fr + =======================================================