Missing HSTS header in https://public-api.wordpress.com
The public-api.wordpress.com OAuth endpoint did not send an HSTS header, so a user's first HTTP request to the site could be intercepted by a man-in-the-middle attacker before the redirect to HTTPS. The report explains that HSTS would prevent this by forcing HTTPS and blocking certificate override.
Originally disclosed on HackerOne
- Disclosed after 45 days
Hi,
Vulnerable Website:
I tested the website using firefox add-on called: Strict Transport Security Detector
https://addons.mozilla.org/en-US/firefox/addon/strict-transport-security-d/
HSTS addresses the following threats:
User bookmarks or manually types http://example.com and is subject to a man-in-the-middle attacker:
HSTS automatically redirects HTTP requests to HTTPS for the target domain
Web application that is intended to be purely HTTPS inadvertently contains HTTP links or serves content over HTTP:
HSTS automatically redirects HTTP requests to HTTPS for the target domain
A man-in-the-middle attacker attempts to intercept traffic from a victim user using an invalid certificate and hopes the user will accept the bad certificate:
HSTS does not allow a user to override the invalid certificate message
more :
HSTS mitigates the following threats.
- HTTP request to an HTTPS site
For example:
- User wants to visit SecureSite.com
- User types SecureSite.com into the address bar
- Browser automatically appends "http://" making the following request: http://SecureSite.com
- Server responds with 301 (permanent redirect) to the following location: https://SecureSite.com
- Browser makes request to above URL
The above scenario allows for a man-in-the-middle attack as a result of the unintentional HTTP request to SecureSite.com. An attacker can leverage a tool such as ssltrip to transparently hijack the HTTP request prior to the 301 redirect. HSTS eliminates this attack window as long as the user previously accessed SecureSite.com over HTTPS and obtained the HSTS header.
Even with HSTS enabled, a user's initial request to SecureSite.com would remain unprotected from attacks. As a result, both Chrome and Mozilla introduced HSTS preload lists. If SecureSite.com is on Chrome's HSTS preload list, a freshly installed Chrome browser will only allow secure connections to that site, even if the user never accessed it before. 2. Insecure link referencing an HSTS enabled site
For example:
- Forum.com includes a link to http://SecureSite.com
- HSTS will automatically convert the link to HTTPS for the HSTS-enabled site
- Invalid Certificate
The following would be considered invalid certificates:
- Self-signed and/or untrusted CA signed certificate
- Expired
- Wrong name specified
references:
http://blog.nvisium.com/2014/04/is-your-site-hsts-enabled.html
https://www.owasp.org/index.php/HTTP_Strict_Transport_Security#Threats
https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security
https://www.owasp.org/index.php/Test_HTTP_Strict_Transport_Security_(OTG-CONFIG-009)
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 server did not include the Strict-Transport-Security header in its HTTPS responses.
Impact
A man-in-the-middle attacker could intercept the initial HTTP request and redirect the user to a malicious site, but only if the user had not previously visited the site over HTTPS.
What the attacker needed
Victim uses HTTP for first visit; attacker on same network
The fix
The server should send the Strict-Transport-Security header on HTTPS responses.
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 security header that tells browsers to always use HTTPS for a site. Without it, the first request a user makes over HTTP can be intercepted by an attacker on the same network, who could redirect the user to a fake site. This report says the site was missing that header.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.