Able to bypass HSTS using trailing dot
curl's HSTS cache matching failed to account for a trailing dot in the hostname, so a URL with a trailing dot was not upgraded to HTTPS even though the site was in the HSTS cache. An attacker who can get a victim to use such a URL could keep the connection on plain HTTP, defeating the protection HSTS is meant to provide.
Originally disclosed on HackerOne
- Disclosed after 14 hours
Summary:
curl allows users to load a HSTS cache which will cause curl to use HTTPS instead of HTTP given a HTTP URL for a given site specified in the HSTS cache.
Affected version
curl version used for reproducing this issue is: 8.16.0
curl --version
curl 8.16.0 (Windows) libcurl/8.16.0 Schannel zlib/1.3.1 WinIDN
Release-Date: 2025-09-10
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets
Steps To Reproduce:
- Use the below curl command:
curl --hsts hsts.txt http://accounts.google.com.
- Observe the below response:
Reference Report:
https://hackerone.com/reports/1557449
Impact
HSTS is bypassed.
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 the HSTS cache lookup compared hostnames literally, so a trailing dot made the name not match the stored entry.
Impact
HSTS is bypassed, so the request stays on plain HTTP.
What the attacker needed
Curl with a loaded HSTS cache; URL uses a trailing dot in the hostname
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.
HSTS is a rule that tells a browser or tool to always use the encrypted HTTPS version of a site, never plain HTTP. curl can keep a list of such sites and upgrade requests automatically. Here, adding a dot at the end of the site name made curl treat it as a different site, so it did not upgrade and stayed on unencrypted HTTP.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.