curl / Docs / curl CVEs / Another HSTS bypass via IDN
Awarded 2400 USD

CVE-2022-43551

Another HSTS bypass via IDN

Project curl Security Advisory, December 21 2022 - Permalink

VULNERABILITY

curl's HSTS check could be bypassed to trick it to keep using HTTP.

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.

The HSTS mechanism could be bypassed if the hostname in the given URL first uses IDN characters that get replaced to ASCII counterparts as part of the IDN conversion. Like using the character UTF-8 U+3002 (IDEOGRAPHIC FULL STOP) instead of the common ASCII full stop (U+002E). Then in a subsequent request, it does not detect the HSTS state and makes a clear text transfer. Because it would store the info IDN encoded but look for it IDN decoded.

Reproducible like this:

curl --hsts hsts.txt https://curl%E3%80%82se
curl --hsts hsts.txt http://curl%E3%80%82se

INFO

This flaw was introduced in commit 7385610d0c7, which was shipped enabled by default from commit d71ff2b9db566b3f in curl 7.77.0.

This issue is similar to both the previous issues CVE-2022-42916 and CVE-2022-30115.

This became a new separate vulnerability simply because we did not properly test and research related side-issues while we worked on fixing the previous issues.

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

CWE-319: Cleartext Transmission of Sensitive Information

Severity: Medium

AFFECTED VERSIONS

curl built without IDN support is not vulnerable.

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

SOLUTION

RECOMMENDATIONS

A - Upgrade curl to version 7.87.0

B - Apply the patch to your local version

C - Stick to always using HTTPS:// in URLs

TIMELINE

This issue was reported to the curl project on October 29, 2022. We contacted distros@openwall on December 12, 2022.

curl 7.87.0 was released on December 21 2022, coordinated with the publication of this advisory.

CREDITS

Thanks a lot!