How Threat Actors Accidentally Documented My Recon Strategy ️
The API trusted the X-Forwarded-Host header when constructing URLs and fetching configuration, allowing an attacker to poison the CDN cache and make the server query internal services and cloud metadata. This exposed internal service names and partial cloud instance metadata.
infosecwriteups.com
Published on infosecwriteups.com
Free link 🎈
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 the application trusted the X-Forwarded-Host header without validation and used it to build URLs and fetch configuration, while the CDN cached responses without considering that header.
Impact
The vulnerability could allow internal infrastructure mapping, sensitive configuration disclosure, and potential privilege escalation, though the metadata response was only partial.
What the attacker needed
Ability to send requests with custom headers; CDN caching enabled for the endpoint
How it was found
- Send a request to the metadata endpoint with a malicious X-Forwarded-Host header.
- Verify that the response is cached by the CDN.
- Send a request with X-Forwarded-Host pointing to an internal hostname to retrieve internal service names.
- Send a request with X-Forwarded-Host pointing to the cloud metadata IP to retrieve instance metadata.
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.
The website trusted a header that tells it which hostname to use, so an attacker could set that header to a malicious or internal address. Because the response was cached, other users would receive the tampered response, and the server could be tricked into fetching internal resources.
What is Cache bugs?
A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.