From Google Dork to Rickroll: PDF.js misconfiguration for quick Bug Bounties
Publicly reachable PDF.js viewer endpoints accept an arbitrary external URL in the file parameter, so an attacker can make a trusted corporate domain render attacker-chosen PDF content. This enables brand abuse and social engineering, and the author suggests SSRF or DoS may also be possible.
I’ve seen plenty of posts about PDF.json Medium. People write about CVEs, sensitive information leaks, reconnaissance, but I believe nobody has mentioned a ridiculously trivial PDF.js misconfiguration that turns into delicious low-hanging fruit 🍊
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.js viewer's file parameter was left unrestricted, so it accepts any external (or internal) URL instead of only same-origin or allow-listed documents.
Impact
The PDF is shown under the company's domain, which the author says is more convincing than off-domain phishing; SSRF and DoS are only suggested as possibilities and were not demonstrated.
What the attacker needed
Publicly reachable PDF.js viewer; attacker-hosted PDF file; victim opens crafted viewer link
The fix
The viewer should be configured to restrict the file parameter to same-origin or allow-listed documents rather than any external URL.
How it was found
- Find PDF.js viewer endpoints with a Google dork, gau, or Shodan.
- Host a PDF on an attacker-controlled site.
- Craft a viewer URL whose file parameter points at that PDF.
- Load the URL and observe the attacker PDF rendered under the victim domain.
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.
PDF.js is a viewer that displays PDF files in a web browser. Its viewer page can take the address of the PDF to show from the URL, and if the site does not restrict which addresses are allowed, anyone can make the company's own page display a file hosted elsewhere. The visitor sees the PDF on the company's trusted domain, which makes a phishing or scam message more convincing.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.