Road to SSRF : PDF generation and filter bypass on ASP.net appli
The application's PDF export feature rendered user-controlled profile fields without proper sanitisation, allowing HTML injection. An attacker could bypass an ASP.NET security filter using full-width Unicode characters, leading to server-side request forgery and access to local files, network shares, and NTLMv2 hash theft.
When I’m on a bug bounty program, I prefer “big” applications that offer a wide range of features, different rendering interfaces and different roles. Here, after spending a good amount of time browsing the application and noting what it offered, I noted an interesting option to export the profile to PDF after…
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 generation component rendered user-supplied HTML without adequate sanitisation, and the ASP.NET input filter could be bypassed using full-width Unicode characters that were later normalised to standard characters.
Impact
An attacker could read local files, enumerate directories, access network shares containing sensitive user data, and steal NTLMv2 hashes, potentially leading to further compromise.
What the attacker needed
A user account with profile editing; ability to export profile to PDF
How it was found
- Identify the PDF export feature that renders profile fields.
- Test basic HTML injection with a simple tag and observe a 500 error from the security filter.
- Bypass the filter by encoding the payload with full-width Unicode characters.
- Confirm the bypass by injecting an iframe pointing to an external server and observing a callback.
- Use the iframe to read local files and list directories on the server.
- Escalate to access network shares and steal NTLMv2 hashes.
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 PDF export feature took text from a user's profile and turned it into a PDF on the server. Because it didn't clean the text properly, an attacker could insert special characters that made the server fetch files or internal resources, which the attacker could then read in the PDF.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.