Skip to content
RCE Write-up Intermediate

LFI and SSRF + IDOR in admin panel file download method real case

An outdated wkhtmltopdf PDF generation endpoint allowed local file inclusion and server-side request forgery, enabling attackers to read sensitive files including a Kubernetes service account token. That token was then used to access an admin panel where an IDOR in a file download API allowed enumeration and download of sensitive files.

OneGuard Cybersecurity Follow

Published on medium.com

In the ever-evolving landscape of cybersecurity, vulnerabilities such as Local File Inclusion (LFI), Server-Side Request Forgery (SSRF), and IDOR(Insecure Direct Object Reference) in admin panel file download method. These flaws, when left unaddressed, can lead to serious breaches, allowing attackers to exploit…

OneGuard Cybersecurity, on medium.com

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 outdated wkhtmltopdf version failed to restrict local file and internal network access, and the admin file download endpoint lacked proper access control checks on the numeric file identifier.

Impact

Attackers could read sensitive server files, access internal network services, bypass authentication to the admin panel, and download confidential files including administrative credentials, potentially leading to full system compromise.

What the attacker needed

Access to the PDF generation endpoint; ability to send POST requests; valid service account token from LFI; access to the admin panel

The fix

The report recommends updating wkhtmltopdf, validating and sanitising inputs, restricting internal access, using indirect object references, and applying rate limiting; it does not state that the issues were fixed.

How it was found

  1. Send a POST request to the PDF generation endpoint with a crafted payload that uses JavaScript to read a local file.
  2. Use the same technique to read the Kubernetes service account token file.
  3. Use the stolen token to authenticate to the admin panel.
  4. Send requests to the file download endpoint with different numeric IDs to enumerate and download sensitive files.

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 used an old tool to turn web pages into PDFs. Because the tool was outdated, attackers could trick it into reading files on the server or making requests to internal systems. One file contained a secret token that let them into the admin area, where a second flaw let them download other users' files by changing a number in the URL.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.