Bypass firewalls with of-CORs and typo-squatting
Internal Tesla web applications were configured with wildcard CORS, allowing any website to read their responses. An attacker used a typo-squatting domain to lure an employee, then a service worker probed internal subdomains and exfiltrated data from 12 misconfigured apps.
Published on trufflesecurity.com
Check out this example of hacking Tesla. It was so much fun that we’re here to share our tooling and techniques with everyone.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely internal applications used wildcard CORS (Access-Control-Allow-Origin: *) without authentication, so any origin could read their responses.
Impact
An attacker could read data from internal applications that lack authentication and have permissive CORS, potentially exposing secrets.
What the attacker needed
Knowledge of internal domain; purchase typo-squat domain; victim mistypes domain; internal app has wildcard CORS
How it was found
- Find internal second-level domains via old commits, Android builds, or StackOverflow.
- Buy a typo-squat domain similar to the internal domain.
- Set up DNS and TLS so all subdomains point to the of-CORS server.
- Configure of-CORS with target domains and a redirect destination.
- Wait for an employee to mistype the internal domain and visit the typo-squat site.
- The service worker probes configured subdomains and reports CORS misconfigurations and HTML content.
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 write-up has not been written yet. The Original tab links to the source.
CORS is a browser rule that lets a website say which other sites may read its data. If a site uses a wildcard, any site can read its responses. Internal apps often have no login, so a malicious site visited by an employee can read their data.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.