Skip to content
File upload Write-up Beginner

Beginner’s Luck? I Found Remote Code Execution on a .GOV Site

A government web application exposed a file upload endpoint built on the jQuery File Upload component with no file type or extension filtering. An attacker could upload a PHP script and run commands on the server, achieving remote code execution.

El Professor Qais Follow

Published on medium.com

It all started when I was diving deep into dorking — the art of using Google search operators to discover publicly exposed resources and potential vulnerabilities. I wasn’t expecting much.

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 handler had no allow-list of file types and stored uploaded files in a web-served directory that executes PHP.

Impact

An attacker could run arbitrary commands on the government server, though the author states no sensitive data was accessed.

What the attacker needed

Publicly reachable upload endpoint; no login mentioned

How it was found

  1. Find a government subdomain whose directory hinted at the jQuery File Upload plugin.
  2. Send a test upload request and read the JSON response, which revealed a custom field name.
  3. Change the request to use that custom field and upload a simple PHP file.
  4. Request the uploaded file with a command parameter and see the command output returned.

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 file upload feature should only accept harmless files like images. Here the server accepted a script file and then ran it, so the author could make the server execute commands of their choosing. That is called remote code execution: running your own code on someone else's machine.

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.