file-upload
This skill should be used when the user asks to "check file upload security", "analyze upload validation", "find upload vulnerabilities", "check for zip…
от florianbuetow★ 22 звезды на GitHub
Установить file-upload в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
File Upload Security (UPLD)
Analyze source code for file upload vulnerabilities including client-only validation, missing content-type verification, no magic byte checking, path traversal in filenames, upload to webroot with execution, and zip slip (archive extraction path traversal). Insecure file uploads can lead to remote code execution, denial of service, and data exfiltration.
Supported Flags
Read ../../shared/schemas/flags.md for the full flag specification. This skill
supports all cross-cutting flags. Key flags for this skill:
--scopedetermines which files to analyze (default:changed)--depth standardreads code and checks upload handlers--depth deeptraces file paths from upload through storage to serving--severityfilters output (upload issues are oftencriticalorhigh)
Framework Context
Key CWEs in scope:
- CWE-434: Unrestricted Upload of File with Dangerous Type
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory
- CWE-79: Cross-Site Scripting (via uploaded HTML/SVG)
- CWE-400: Uncontrolled Resource Consumption (via file size)
- CWE-611: Improper Restriction of XML External Entity Reference (via uploaded XML)
Detection Patterns
Read references/detection-patterns.md for the full catalog of code patterns,
search heuristics, language-specific examples, and false positive guidance.
Workflow
1. Determine Scope
Parse flags and resolve the file list per ../../shared/schemas/flags.md.
Filter to files likely to contain upload logic:
- Upload handlers (
**/upload/**,**/uploads/**,**/attachments/**) - File processing (
**/files/**,**/media/**,**/storage/**) - Multipart form handling (
**/middleware/**,**/controllers/**) - Archive extraction (
**/extract/**,**/unzip/**,**/import/**) - Frontend validation (
**/components/**,**/views/**)
2. Check for Available Scanners
Detect scanners per ../../shared/schemas/scanners.md:
semgrep-- primary scanner for upload patternsbandit-- Python file handling issuesbrakeman-- Rails file upload vulnerabilities
Record which scanners are available and which are missing.
3. Run Scanners (If Available)
If semgrep is available, run with rules targeting upload security:
semgrep scan --config auto --json --quiet <target>
Filter results to rules matching file upload, path traversal, and content-type patterns. Normalize output to the findings schema.
4. Claude Code Analysis
Regardless of scanner availability, perform manual code analysis:
- Client-only validation: Find client-side file type checks (HTML
acceptattribute, JavaScript validation) without corresponding server-side checks. - Content-type verification: Check upload handlers verify Content-Type against an allowlist and do not trust the client-provided value alone.
- Magic byte validation: Verify upload handlers check file magic bytes (file signatures) to confirm the file type matches the claimed type.
- Path traversal in filename: Find places where the original filename is used in file path construction without sanitization.
- Upload to webroot: Check whether uploaded files are stored in web-accessible directories where they could be executed.
- Archive extraction: Find zip/tar extraction code and verify paths are validated to prevent directory traversal (zip slip).
When --depth deep, additionally trace:
- Full file path from upload to storage to serving
- File serving configuration (static file handlers, CDN configuration)
- Archive extraction to final storage location
5. Report Findings
Format output per ../../shared/schemas/findings.md using the UPLD prefix
(e.g., UPLD-001, UPLD-002).
Include for each finding:
- Severity and confidence
- Exact file location with code snippet
- Attack scenario (what malicious file could achieve)
- Concrete fix with diff when possible
- CWE and OWASP references
What to Look For
These are the high-signal patterns specific to file upload security. Each
maps to a detection pattern in references/detection-patterns.md.
Client-only file type validation -- HTML
acceptattribute or JavaScript checks without server-side enforcement.Missing content-type verification -- Upload handler accepts any file type or trusts the client-provided Content-Type header.
No magic byte validation -- File type determined solely by extension or Content-Type, not by reading the file header bytes.
Path traversal in filename -- Original filename used in path construction (e.g.,
../../../etc/passwd) without sanitization.Upload to executable directory -- Files stored in webroot where a server could execute uploaded scripts (
.php,.jsp,.py).Zip slip vulnerability -- Archive extraction writes files outside the intended directory via
../entries in archive member paths.Missing file size limit -- No server
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/detection-patterns.md
FAQ
Что делает скилл file-upload?
This skill should be used when the user asks to "check file upload security", "analyze upload validation", "find upload vulnerabilities", "check for zip slip", "audit file upload handling", or mentions "file upload", "upload validation", "content-type check", "magic bytes", "zip slip", or "path traversal in upload" in a security context.
Как установить скилл file-upload?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл file-upload запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…