Cheat Sheet Guide for QA: File Upload Testing in 11 steps

Asset 19@4x
Cheat sheet guide for QA file upload testing. Comprehensive checklist for testing file uploads and attachments.

File upload testing in 11 steps

File upload functionality is essential across modern applications - from user profile photos to CVs, project videos to document attachments. But file uploads also represent one of the most exploited attack vectors in web security. This technical checklist covers the 11 critical test cases every QA engineer should execute when validating file upload features.

11 Critical test areas
OWASP Security standard
API + UI Testing layers

Why file upload testing matters

File upload vulnerabilities consistently rank among the most dangerous security weaknesses in web applications. Attackers can exploit improperly validated uploads to execute malicious code on servers, bypass authentication, exfiltrate data, or launch denial-of-service attacks. What appears to be a simple feature can become an open door for complete system compromise if not thoroughly tested.

Risk 01
Remote Code Execution

Attackers upload executable files disguised as images or documents. Without proper validation, servers may execute malicious code, leading to complete system takeover.

Risk 02
Path Traversal

Malicious filenames containing sequences like "../" can trick applications into writing files outside intended directories, overwriting critical system files.

Risk 03
Denial of Service

Without size limits, attackers can exhaust server storage or memory with massive file uploads, or trigger infinite loops with specially crafted file contents.

File upload testing: Steps 1-6

The following checklist is adapted from OWASP's File Upload Cheat Sheet, translated from a developer's perspective to a QA testing perspective. Execute each test case across all supported browsers and devices.

1
Validate Allowed Extensions

Start with the extensions your application explicitly allows. Test that each permitted extension uploads successfully across all supported browsers and devices. Then verify that disallowed extensions are properly rejected with clear error messages. Check both uppercase and lowercase variants (.JPG vs .jpg) and mixed case (.JpG).

2
Test Malicious File Names

File names are a prime attack vector. Test with weird characters, naughty strings, and injection attempts. Try null byte injection (e.g., evil.php%00.jpg) where the .jpg gets truncated and .php becomes the actual extension. Test path traversal patterns (../../../etc/passwd) and SQL injection in filenames.

3
Test Edge Case File Names

Push filename handling to its limits. Upload files with names that are just a single space, just emojis, or 500,000 characters long. Test empty filenames, filenames with only special characters, and filenames that match reserved system names (CON, PRN, AUX on Windows). The application should handle all these gracefully.

4
Verify File Size Limits

Test that file size restrictions are enforced both client-side and server-side. Attempt to upload files significantly larger than the allowed maximum - a 1GB PDF should never be accepted if your limit is 10MB. Bypass client-side validation using browser developer tools or Postman to verify the server also enforces limits.

5
Test Authorization Controls

Verify that only authorized users can upload files. Test by hijacking a session ID from a user who shouldn't have upload permissions. Check if unauthenticated users can access the upload endpoint. Import the upload request into Postman and manipulate authentication tokens to verify server-side authorization checks.

6
Test for Malicious Content

Verify the application validates file content, not just extensions. Rename an .exe file to .jpg and attempt to upload it - this should fail. Test with polyglot files that are valid in multiple formats. Try uploading .zip files (often disallowed due to zip bomb risks).

File upload testing: Steps 7-11

These final test cases cover advanced security scenarios including CSRF protection, rate limiting, content moderation, API validation, and image processing security. Each represents a potential vulnerability that sophisticated attackers routinely exploit.

7
Test CSRF Protection

Cross-Site Request Forgery attacks can trick browsers into uploading files to malicious destinations. Verify the upload endpoint validates CSRF tokens. Create a test page on a different domain that attempts to POST a file to your upload endpoint - this should fail.

8
Test Rate Limiting

Rapid repeated requests can overwhelm servers. Script 1000 consecutive file download requests for the same uploaded file - the response is larger than the request, so this amplification can cause server delays. Verify rate limiting kicks in.

9
Test Content Moderation

For publicly accessible upload features, verify the application handles inappropriate content. Attempt to upload illegal, offensive, or dangerous material. Test with copyrighted content - platforms like YouTube automatically detect and block copyrighted music in video uploads.

10
Verify Content-Type Header Validation

Examine the API request during file upload using browser developer tools or a proxy. Verify the request includes Content-Type validation and that the server validates it matches actual file content. Test by sending requests with mismatched Content-Type headers.

11
Test Image Rewriting Security

Image rewriting (re-encoding uploaded images through a library like ImageMagick) destroys malicious content injected into image files. Test whether your application performs image rewriting. Attempt to upload images with embedded JavaScript or PHP code in EXIF metadata - after download, verify the malicious payload has been stripped.

Common file validation checks

Use this reference table when planning your file upload test cases. Each file type has specific validation requirements and associated risks that your testing should address.

File Type MIME Type Security Risks Validation Checks
Images (JPG, PNG, GIF) image/jpeg, image/png, image/gif Embedded scripts in metadata, polyglot files Magic bytes, image rewriting, EXIF stripping
PDF Documents application/pdf JavaScript execution, embedded files, XSS Content scanning, size limits, sandbox viewing
Office Documents application/vnd.ms-*, application/vnd.openxmlformats-* Macro execution, embedded OLE objects Macro detection, format validation, sandboxing
Archives (ZIP, RAR) application/zip, application/x-rar-compressed Zip bombs, path traversal, hidden executables Decompression limits, nested archive blocking
Video/Audio video/mp4, audio/mpeg Codec exploits, embedded content, large sizes Transcoding, metadata stripping, size limits
SVG Images image/svg+xml Embedded JavaScript, XSS, SSRF via external refs XML sanitization, script removal, CSP headers
Testing Tip

Always test Content-Type spoofing by sending files with incorrect MIME types. A well-secured application validates both the declared Content-Type header AND the actual file content using magic bytes or file signature analysis.

Recommended testing tools

These tools help automate and systematize file upload testing. Combine automated scanning with manual exploratory testing for comprehensive coverage.

Tool 01
Burp Suite

Intercept and modify upload requests in real-time. Test Content-Type manipulation, inject payloads into filenames, and automate repeating tests with Intruder. Essential for API-level file upload testing.

Tool 02
Postman

Import browser-captured requests and modify authentication tokens, headers, and file contents. Build collections of file upload test cases that can be run repeatedly across environments.

Tool 03
OWASP ZAP

Open-source web security scanner that can automatically test file upload endpoints for common vulnerabilities including path traversal, CSRF weaknesses, and content-type bypasses.

Tool 04
Naughty Strings

A curated list of strings known to cause issues in software - use for filename testing. Includes null bytes, Unicode edge cases, SQL injection patterns, and XSS payloads.

How BetterQA tests file upload security

At BetterQA, file upload testing is a standard component of our security testing services. Our team of 50+ QA engineers systematically validates upload functionality against OWASP standards while adapting test cases to each application's specific requirements and risk profile.

We use a combination of automated scanning with tools like Burp Suite and OWASP ZAP, plus manual exploratory testing for edge cases that automated tools miss. Our engineers document findings using BugBoard, which captures screenshots, network requests, and reproduction steps in a standardized format that developers can act on immediately.

For applications where file uploads are a core feature - document management systems, social platforms, content management - we recommend integrating file upload security tests into CI/CD pipelines. This ensures that new code changes don't introduce regressions in upload validation logic.

Frequently asked questions

What's the most critical file upload vulnerability to test for?
Remote code execution through extension bypass is the highest-severity vulnerability. Test that renaming executable files to allowed extensions (e.g., malware.php.jpg) doesn't result in server-side execution. Verify the server validates actual file content, not just the extension.
Should I test file uploads differently for mobile apps?
Yes. Mobile apps often handle file uploads through native libraries that may have different validation behaviors than web browsers. Test on actual devices, not just emulators. Check how the app handles camera-captured images versus gallery selections.
How do I test file uploads without access to server logs?
Use observable behaviors: error messages, response times, HTTP status codes, and whether files appear in expected locations. For security testing, try uploading files that would cause observable effects if executed. Work with developers to get log access for security-critical testing.
What file size limits should I recommend?
Limits depend on the use case. Profile photos typically need 2-5MB maximum. Document uploads might allow 10-25MB. Video platforms may accept hundreds of megabytes but should implement chunked uploads. Whatever the limit, ensure it's enforced server-side.

Need help with security testing?

Talk to our team about comprehensive file upload security testing for your application.

Book a discovery call
Industry Data: According to OWASP, unrestricted file upload vulnerabilities rank among the top 10 web application security risks, with 43% of web apps having at least one file upload vulnerability.
“File upload testing is where security meets functionality. A single bypass can turn your file upload into an open door for attackers.” — Tudor Brad, Founder of BetterQA (15+ years in QA)

Need help with software testing?

BetterQA provides independent QA services with 50+ engineers across manual testing, automation, security audits, and performance testing.

Share the Post: