TLS Abuse leads to Remote Code Execution
A server-side request forgery (SSRF) endpoint allowed an attacker to make the server connect to a controlled TLS server, which injected arbitrary data into the TLS session ticket. Combined with DNS rebinding, the poisoned session ticket was later sent to an internal plaintext service, where the injected data was interpreted as commands, leading to remote code execution.
medium.com
Published on medium.com
Ever heard of TLS poisoning? Probably not, and you’re not alone.
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 SSRF endpoint allowed connections to attacker-controlled servers, and the TLS session ticket was cached without validation, enabling injection into an internal plaintext service via DNS rebinding.
Impact
An attacker could achieve remote code execution on the internal service, potentially compromising the entire system.
What the attacker needed
SSRF vulnerability in the target; Attacker-controlled domain and TLS server; DNS rebinding capability; Internal plaintext service on a known port
The fix
The SSRF vulnerability should be fixed by restricting outbound connections to trusted domains and validating URLs, and internal services should not accept plaintext connections from untrusted sources.
How it was found
- Set up a custom TLS server that injects a payload into the session ticket.
- Use DNS rebinding to make the domain resolve to the internal service's IP.
- Trigger the SSRF endpoint to connect to the domain, causing the client to cache the poisoned ticket.
- Trigger a second connection to the same domain, now resolving to the internal service, which sends the poisoned ticket.
- The internal service interprets the injected data as commands, leading to file creation and code execution.
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 application had a feature that fetched URLs for you. An attacker could make it fetch a URL from a server they controlled, and that server could sneak extra data into a part of the secure connection setup that gets saved for later. Then, by changing what address the domain pointed to, the attacker made the saved data get sent to a different internal service that didn't expect it, and that service ran the data as commands.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.