Skip to content
File upload Write-up Beginner

How I Found a Critical Vulnerability on a GOV.MY Web App —�

A standalone PHP upload script on a government website accepted files without any server-side validation, and the uploaded PHP file was then executed by the server. An attacker could upload and run arbitrary code, achieving remote code execution.

El Professor Qais Follow

Published on medium.com

A few months ago, during one of my usual late-night bug hunting sessions, I stumbled upon something serious — a critical file upload vulnerability on a Malaysian government website. Yep, GOV.MY.

El Professor Qais, 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 upload script had no server-side file type or extension validation, so it stored and executed PHP files.

Impact

An attacker could run arbitrary code on the server, which the author says could be used for defacement, malware hosting or data theft.

What the attacker needed

Internet access; knowledge of the upload endpoint

The fix

The bug was silently patched a few days later, though the text does not describe the fix itself.

How it was found

  1. Find an HTML file on a .gov.my domain via a Google dork.
  2. View the page source and spot a standalone upload.php path.
  3. Build a form that posts a file to that upload endpoint.
  4. Upload a PHP file and open it in the browser to confirm execution.

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 website let people upload files, but it did not check what kind of file was being sent. The author uploaded a small program written in PHP (a language many websites use) and the server ran it, which means the attacker could make the server do almost anything. This is called remote code execution, or RCE.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by El Professor Qais

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.