SSRF on PDF generator
The PDF generator was vulnerable to server-side request forgery (SSRF) because it rendered user-supplied iframe tags, allowing requests to internal addresses. By using a subdomain pointing to localhost, the attacker could access an internal error log file that was otherwise forbidden.
Published on medium.com
Hello, How are you guys doing? This is my first write-up.
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 generator did not validate or restrict URLs in iframe tags, allowing requests to internal resources.
Impact
An attacker could access internal resources such as error logs, potentially exposing sensitive information.
What the attacker needed
Mobile app access; web app access; ability to create subdomain
The fix
The issue was fixed by the company.
How it was found
- Insert an iframe payload via the mobile app, using forward slashes as spacing to bypass filtering.
- Create a subdomain with DNS pointing to 127.0.0.1.
- Use the 'save as PDF' function on the web app to trigger the payload.
- Brute force directories to find internal files like elmah.axd.
- Insert a payload pointing to the internal file via the mobile app.
- Use 'save as PDF' again to retrieve the error logs.
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.
SSRF (Server-Side Request Forgery) is when a server is tricked into making requests to internal systems on the attacker's behalf. Here, the PDF generator fetched a web page specified in an iframe tag, so the attacker could point it at internal addresses like localhost. This let them read internal files that were not accessible from the internet.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.