In-depth lesson · File upload
Root causes
Every point the File upload reports back under this heading, best-backed first, each with the reports it is seen in.
-
A privileged service wrote its log into a user-writable directory without checking for reparse points, so a symlink redirected the write.
Seen in 2 reports
-
The upload checked only the declared content type and not the real content or extension, so executable class files were stored and served.
Seen in 1 report
-
An unauthenticated endpoint took the filename and extension from the request without validation, allowing traversal and arbitrary writes.
Seen in 1 report
-
Attachments were stored in a shared bucket under a key based only on the original filename, with no per-user prefix, so a later upload replaced the earlier object.
Seen in 1 report
-
The profile picture upload did not validate file type, so a script file disguised as an image was saved and executed.
Seen in 1 report
-
The remote avatar URL path skipped the file type checks that the direct upload path applied.
Seen in 1 report
-
The extension check could be defeated by a trailing space and the upload directory executed server-side scripts.
Seen in 1 report
-
The handler only looked at the filename extension and did not stop uploaded files being served as active content.
Seen in 1 report
-
The server did not validate type or extension and served uploaded files with a content type that allowed HTML execution.
Seen in 1 report
-
The snippet feature did not enforce that the displayed file type matched the actual content.
Seen in 1 report
-
The option-parsing check only rejected one ordering of the flags and the header-writing path could rename over an existing file without the usual existence check.
Seen in 1 report
-
The application did not escape double quotes in the filename before inserting it into the Content-Disposition header.
Seen in 1 report
-
The web server was misconfigured to allow unauthenticated PUT requests, enabling arbitrary file writes.
Seen in 1 report
-
The server relied only on a client-side JavaScript check for allowed file types.
Seen in 1 report
-
Rails Active Storage direct upload routes were left publicly accessible, letting any authenticated user create blobs and obtain signed upload URLs.
-
The validator checked the extension after the null byte while the web server used the full filename and executed the dangerous part.
Seen in 1 report
-
A newer version of the plantuml extension enabled a block macro processor by default, permitting arbitrary local file reads.
Seen in 1 report
-
The counter function set document attributes without checking whether they were locked, overriding security-sensitive settings.
Seen in 1 report
-
The output path from the libcurl option was passed straight to fopen with no validation.
Seen in 1 report
-
The file move method failed to re-check the user's original save choice against the new filename and directory.
Seen in 1 report
-
The save layer stripped percent patterns and then re-attached the pre-sanitisation extension, producing a double extension.
Seen in 1 report
-
The Vips transformer inherited a base validation that only blocked one option instead of applying the allowlist and denylist used by the ImageMagick transformer.
-
The cache file was opened in write mode before validating the path, so fopen followed the symlink and truncated the target.
Seen in 1 report
-
The upload check trusted an image-size function that treats Flash files as valid images and served them from the same origin.
Seen in 1 report