file-upload-security
Skill17 starsChanged 47 days agoMITView on GitHub
Analyze unsafe file upload handling — use when reviewing multipart uploads, extension/MIME checks, stored filenames, image processors, or user-supplied archives (CWE-434 / A04:2021).
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
After AXguard hits upload.* or related path.*.
- Distinctive: line 47
No file ingress exists (JSON-only APIs).
- Distinctive: line 66
Check extension allowlist vs denylist.
- Distinctive: line 70
Check authZ: who can upload / overwrite / read whose objects.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
File Upload Security
Purpose
Guide pre-ship review of unrestricted or weakly restricted file uploads: content that is stored, served, or processed unsafely leading to RCE, XSS, traversal, or malware distribution.
When to Use / When Not to Use
Use when:
- Multipart endpoints, avatar/doc uploads,
multer,Busboy, DjangoFileField, S3 presigned PUT, archive import, antivirus-less pipelines. - After AXguard hits
upload.*or relatedpath.*. - Uploaded files are later executed, included, or served as HTML/JS.
Do not use when:
- No file ingress exists (JSON-only APIs).
- Upload is delegated entirely to a hardened third-party with app-only metadata (still review URL/XSS when displaying).
Security Concepts
Upload risk is a pipeline: accept → name → store → process → serve. Controls must cover type (magic bytes + allowlist), size, path, virus/content policy, and Content-Type when serving. Extension checks alone are insufficient.
Threat Model
Attacker goals:
- Upload executable/script into a webroot or template path.
- Store HTML/SVG that executes as XSS when served.
- Zip-slip / oversized archives (DoS) during extract.
- Polyglot files that bypass MIME sniffing or image pipelines (ImageTragick-class).
Analysis Workflow
- Map upload endpoints and storage destinations (disk, S3, CDN).
- Check extension allowlist vs denylist; confirm MIME and magic-byte validation.
- Inspect filename handling — user-controlled names vs random object keys.
- Determine if files are served from the app origin with user Content-Type / inline disposition.
- Review processors (ImageMagick, LibreOffice, ffmpeg, unzip) for known unsafe flags and shelling out.
- Check authZ: who can upload / overwrite / read whose objects.
- Confirm size limits, rate limits, and malware scanning expectations for the threat model.
Evidence Requirements
- Upload handler location
- Missing type/size/name controls
- Dangerous serve or process path
- Impact class (RCE / stored XSS / traversal / DoS)
False Positive Controls
- Strict allowlist + random keys + non-executable storage + safe Content-Disposition
- Uploads never served back as active content
- Admin-only internal tooling with compensating network controls (still note residual risk)
Remediation
- Allowlist extensions and verify content signatures; reject mismatches.
- Store under random keys outside webroot; never use raw user filenames on disk.
- Serve via separate domain with
Content-Disposition: attachmentand fixed safe Content-Type where possible. - Process in isolated workers with resource limits; patch converters.
- Enforce authN/authZ, quotas, and malware scanning for high-risk products.
Verification
Review accept→serve pipeline → Apply allowlist + random keys → Re-run axguard → Confirm no executable serve pathRelated Skills
path-traversal,xss-analysis,command-injection,deserialization-securitysecurity-triage,security-remediation
Framework Mapping
- CWE-434
- OWASP Top 10 2021 A04:2021 Insecure Design
- OWASP API Security Top 10 2023 API8:2023 Security Misconfiguration
References
- https://owasp.org/Top10/A04_2021-Insecure_Design/
- https://owasp.org/API-Security/editions/2023/en/api8-security-misconfiguration/
- https://cwe.mitre.org/data/definitions/434.html
Research Provenance
Primary sources:
- OWASP Top 10:2021 A04; OWASP API8:2023; CWE-434 (accessed 2026-09-15)
Secondary / internal:
- AXGuard
rules/upload.json,/axguard-upload - AwareXone Agentic-Bug-Hunter upload methodology (concepts only; not copied)
Datasets:
- UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- wpultimatesecurity/WordPress-Security-Skills★ 45same name
- GoldenWing-360/claude-security-skills★ 16same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-agent-securitySkill
- ai-application-securitySkill
- api-securitySkill
- attack-surface-mappingSkill
- authentication-analysisSkill
- authorization-analysisSkill
- axguard-auditSkill
- axguard-csoSkill
- axguard-knowledgeSkill
- axguard-preshipSkill
- axguard-remediateSkill
- axguard-reportSkill
- axguard-securitySkill
- axguard-triageSkill
- cloud-securitySkill
- command-injectionSkill
- configuration-securitySkill
- deserialization-securitySkill
- graphql-securitySkill
- jwt-securitySkill
- mcp-securitySkill
- oauth-securitySkill
- path-traversalSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- secrets-detectionSkill
- security-architecture-reviewSkill
- security-remediationSkill
- security-triageSkill
- session-securitySkill
- sql-injectionSkill
- ssrf-analysisSkill
- ssti-analysisSkill
- supply-chain-securitySkill
- threat-modelingSkill
- websocket-securitySkill
- xss-analysisSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

