
=====================================================================

                               CERT-Renater

                    Note d'Information No. 2023/VULN087

_____________________________________________________________________

DATE                : 17/02/2023

HARDWARE PLATFORM(S): /

OPERATING SYSTEM(S): Systems running curl versions from 7.77.0 up to 
                    and including 7.87.0 prior to 7.88.0.

=====================================================================
https://curl.se/docs/CVE-2023-23914.html
https://curl.se/docs/CVE-2023-23915.html
https://curl.se/docs/CVE-2023-23916.html
_____________________________________________________________________


CVE-2023-23914: HSTS ignored on multiple requests
=================================================

Project curl Security Advisory, February 15 2023 -
[Permalink](https://curl.se/docs/CVE-2023-23914.html)

VULNERABILITY
-------------

curl's HSTS functionality fail when multiple URLs are requested serially.

Using its HSTS support, curl can be instructed to use HTTPS instead of 
using an insecure clear-text HTTP step even when HTTP is provided in the 
URL. This HSTS mechanism would however suprisingly be ignored by 
subsequent transfers when done on the same command line because the 
state would not be properly
carried on.

Reproducible like this:

      curl --hsts "" https://curl.se http://curl.se

The first URL returns HSTS information that the second URL fails to take 
advantage of.

We are not aware of any exploit of this flaw.

INFO
----

This is a curl command line issue and does not affect libcurl.

This flaw was introduced in [commit
7385610d0c7](https://github.com/curl/curl/commit/7385610d0c7), which was 
shipped enabled by default from [commit
d71ff2b9db566b3f](https://github.com/curl/curl/commit/d71ff2b9db566b3f) in
curl 7.77.0.

The Common Vulnerabilities and Exposures (CVE) project has assigned the 
name CVE-2023-23914 to this issue.

CWE-319: Cleartext Transmission of Sensitive Information

Severity: Low


AFFECTED VERSIONS
-----------------

- Affected versions: curl 7.77.0 to and including 7.87.0
- Not affected versions: curl < 7.77.0 and curl >= 7.88.0

curl is used by many applications, but not always advertised as such!


THE SOLUTION
------------

7.88.0 will share the HSTS state properly between transfers.

A [fix for CVE-2023-23914](https://github.com/curl/curl/pull/10138)

RECOMMENDATIONS
--------------

   A - Upgrade curl to version 7.88.0

   B - Apply the patch to your local version

   C - Specify all URLs with `HTTPS://` and not `HTTP://`


TIMELINE
--------

This issue was reported to the curl project on December 21, 2022. We 
contacted distros@...nwall on February 7, 2022.

curl 7.88.0 was released on February 15 2023, coordinated with the 
publication of this advisory.


CREDITS
-------

- 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-2023-23915: HSTS amnesia with --parallel
============================================

Project curl Security Advisory, February 15 2023 -
[Permalink](https://curl.se/docs/CVE-2023-23915.html)

VULNERABILITY
-------------

curl's HSTS cache saving behaves wrongly when multiple URLs are 
requested in parallel.

Using its HSTS support, curl can be instructed to use HTTPS instead of 
using an insecure clear-text HTTP step even when HTTP is provided in the 
URL. This HSTS mechanism would however surprisingly fail when multiple 
transfers are done in parallel as the HSTS cache file gets overwritten 
by the most recently
completed transfer.

A later HTTP-only transfer to the earlier host name would then *not* get 
upgraded properly to HSTS.

Reproducible like this:

1. `curl --hsts hsts.txt --parallel https://curl.se https://example.com`
2. `curl --hsts hsts.txt http://curl.se`

We are not aware of any exploit of this flaw.

INFO
----

This is a curl command line issue and does not affect libcurl.

This flaw was introduced in [commit
7385610d0c7](https://github.com/curl/curl/commit/7385610d0c7), which was 
shipped enabled by default from [commit
d71ff2b9db566b3f](https://github.com/curl/curl/commit/d71ff2b9db566b3f) 
in curl 7.77.0.

The Common Vulnerabilities and Exposures (CVE) project has assigned the 
name CVE-2023-23915 to this issue.


CWE-319: Cleartext Transmission of Sensitive Information

Severity: Low


AFFECTED VERSIONS
-----------------

- Affected versions: curl 7.77.0 to and including 7.87.0
- Not affected versions: curl < 7.77.0 and curl >= 7.88.0

curl is used by many applications, but not always advertised as such!


THE SOLUTION
------------

7.88.0 will share the HSTS state properly between transfers, making each 
subsequent save store a complete state.

A [fix for CVE-2023-23914](https://github.com/curl/curl/pull/10138)


RECOMMENDATIONS
--------------

   A - Upgrade curl to version 7.88.0

   B - Apply the patch to your local version

   C - Specify all URLs with `HTTPS://` and not `HTTP://`


TIMELINE
--------

This issue was reported to the curl project on December 21, 2022. We 
contacted distros@...nwall on February 7, 2022.

curl 7.88.0 was released on February 15 2023, coordinated with the 
publication of this advisory.


CREDITS
-------

- 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-2023-23916: HTTP multi-header compression denial of service
===============================================================

Project curl Security Advisory, February 15th 2023 -
[Permalink](https://curl.se/docs/CVE-2023-23916.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 capped, but the cap was implemented on a 
per-header basis allowing a malicious server to insert a virtually 
unlimited number of compression steps simply by using many headers.

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-2023-23916 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 one or more of the compression algorithms built-in 
(gzip, brotli or zstd), but the individual algorithms have different 
"exploding" powers.

Both `Content-Encoding:` and `Transfer-Encoding:` are affected over all 
HTTP versions.

This flaw is almost identical to the previous [CVE-2022-32206: HTTP
compression denial of service]
(https://curl.se/docs/CVE-2022-32206.html), as the fix for that earlier 
flaw was incomplete.

CWE-770: Allocation of Resources Without Limits or Throttling

Severity: Medium


AFFECTED VERSIONS
-----------------

- Affected versions: curl 7.57.0 to and including 7.87.0
- Not affected versions: curl < 7.57.0 and curl >= 7.87.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 in total, 
independently of the number of headers.

A [fix for 
CVE-2023-23916](https://github.com/curl/curl/commit/119fb187192a9ea13dc)


RECOMMENDATIONS
--------------

   A - Upgrade curl to version 7.88.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 January 8, 2023. We 
contacted distros@...nwall on February 7, 2023.

libcurl 7.88.0 was released on February 15 2023, coordinated with the 
publication of this advisory.


CREDITS
-------

- Reported-by: Patrick Monnerat
- Patched-by: Patrick Monnerat


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 +
=========================================================

