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.
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.
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
- Find an HTML file on a .gov.my domain via a Google dork.
- View the page source and spot a standalone upload.php path.
- Build a form that posts a file to that upload endpoint.
- 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.