Skip to content
File upload Write-up Beginner

Arbitrary File Upload via “External Files” feature allows cli

The External Files upload feature only enforced file type and size restrictions in the browser, so an attacker could upload a malicious .hta file that executes code when downloaded and opened. This allowed any authenticated user to distribute executable content within the platform.

venomnis Follow

Published on medium.com

During an assessment of a web-based platform (hereinafter referred to as [REDACTED]), I identified a critical vulnerability in the file upload mechanism exposed through the External Files feature within the project dashboard. This feature is designed to allow authenticated users to import supplementary documentation…

venomnis, 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

The server trusted client-side validation and did not independently verify file extension, MIME type, or content.

Impact

Any authenticated user could upload and distribute executable files to other users of the same project, potentially leading to code execution on their machines if opened.

What the attacker needed

Authenticated user; victim downloads and opens file

The fix

The upload endpoint should enforce a server-side allowlist that verifies file extension, MIME type, and content magic bytes.

How it was found

  1. Intercept a legitimate .txt upload request with a web proxy.
  2. Modify the fileName field to payload.hta and fileType to application/hta.
  3. Inject executable HTA markup into uploadData.content.
  4. Send the request; the server accepts and stores the file.
  5. The malicious file appears in the UI for download.

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 website checked file types only in your browser, not on the server. So someone could change the file name and content to upload a dangerous file that runs code when opened. This is like a bouncer who only checks IDs at the front door but lets anyone in through the back.

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.

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.