How a PDF File Can Expose Your Application’s Real IP (Even with CDN and WAF)
A file upload feature allowed a PDF containing a canary token to be processed by the backend server, which automatically fetched the token's remote URL. This request revealed the server's real IP address, bypassing the CDN and WAF protections.
Today, many believe that simply placing a CDN (Content Delivery Network) and a WAF (Web Application Firewall) in front of an application is enough to protect it from direct attacks. And indeed, these solutions help a lot: they hide the server’s real IP, filter malicious requests, enforce access limits, and so on.
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 PDF rendering library automatically fetched external resources embedded in uploaded files, and the backend server had direct internet access, so its real IP was exposed.
Impact
An attacker could bypass the CDN and WAF, directly target the origin server, scan for open ports, launch DDoS attacks, and exploit internal services.
What the attacker needed
File upload feature; server processes uploaded files; server has internet access
The fix
The application should sanitise uploaded files to remove external references, process files in an isolated environment without internet access, block outbound traffic from file processing servers, and restrict the origin server to accept connections only from the CDN or WAF.
How it was found
- Create a canary token in a format the application accepts, such as PDF.
- Log in to the application and upload the canary token file through the file upload feature.
- Find and open the uploaded file in the application so the server processes it.
- Check the email alert from the canary token service, which shows the real IP of the server that processed the file.
- Access the application directly using the revealed IP address instead of the domain name.
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.
A CDN and WAF are services that sit in front of a website to hide its real server and block attacks. Here, the website let users upload PDF files, and when the server opened the PDF, it automatically loaded a link inside it. That link was a trap that recorded the server's real address, so the protection was bypassed.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.