curl / Docs / curl CVEs / HSTS bypass via trailing dot
Awarded 2400 USD


HSTS bypass via trailing dot

Project curl Security Advisory, May 11 2022 - Permalink


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 directly instead of using an insecure clear-text HTTP step even when HTTP is provided in the URL. This mechanism could be bypassed if the hostname in the given URL used a trailing dot while not using one when it built the HSTS cache. Or the other way around - by having the trailing dot in the HSTS cache and not using the trailing dot in the URL.

Since trailing dots in hostnames are somewhat special, many sites work equally fine with or without a trailing dot present.


This flaw was introduced in commit b27ad8e1d3e68e, shipped in curl 7.82.0 when the treatment of trailing dot hostnames was changed.

Similar issues have been raised in the past for Firefox and for Chrome.

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

CWE-319: Cleartext Transmission of Sensitive Information

Severity: Medium


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



A - Upgrade curl to version 7.83.1

B - Apply the patch to your local version

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


This issue was reported to the curl project on May 3, 2022. We contacted distros@openwall on May 5.

libcurl 7.83.1 was released on May 11 2022, coordinated with the publication of this advisory.


Thanks a lot!