detecting-file-upload-vulnerabilities

Detects unrestricted file upload vulnerabilities in Spring Boot and JSP/Servlet applications.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/bs-koo/gx-security --skill detecting-file-upload-vulnerabilities-bs-koo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: detecting-file-upload-vulnerabilities
Source: https://github.com/bs-koo/gx-security/tree/main/skills/detecting-file-upload-vulnerabilities
Command: npx skills add https://github.com/bs-koo/gx-security --skill detecting-file-upload-vulnerabilities-bs-koo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Web applications with file upload features (board attachments, certificate registration, bulk Excel uploads) can allow attackers to upload web shells (.jsp) when extension whitelists, magic-byte validation, or safe storage paths are missing, leading to remote code execution (CWE-434). ## Core Features & Use Cases - Hybrid two-stage scanning: A Python scanner collects candidates via Semgrep rules (with grep fallback), then AI context verification filters false positives by checking validation calls, storage paths, and filename handling. - Dual stack support: Automatically detects spring-modern (Spring Boot + MultipartFile) and jsp-legacy (JSP/Servlet + commons-fileupload) stacks and applies matching rules. - Use Case: Point the scanner at a project like Gseed_Web_Renew to find controllers calling transferTo() without FileValidator.validate(), uploads stored inside the web root via getRealPath(), or ZipSlip risks in ZIP extraction code, then receive a severity-ranked report with fix guidance. ## Quick Start Run the file upload vulnerability check on my project source directory and report confirmed CWE-434 issues with file and line evidence.

Frequently Asked Questions about detecting-file-upload-vulnerabilities

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect file upload vulnerabilities in a Spring Boot application?▼

Run the scan_upload.py script against the project source; it detects the stack, applies Semgrep rules for transferTo() without validation, getRealPath() storage, and getOriginalFilename() misuse, then AI verification confirms which candidates are real vulnerabilities.

What is CWE-434 and why is it dangerous?▼

CWE-434 is the unrestricted upload of files with dangerous types. When a server accepts files without extension whitelists or magic-byte checks, attackers can upload web shells like .jsp files and execute commands on the server via HTTP requests.

Does the scanner work without Semgrep installed?▼

Yes, it falls back to regex-based grep scanning when Semgrep is unavailable. The fallback has lower recall, so the tool prints a warning and relies more heavily on AI context verification for final judgments.

Can it scan legacy JSP and Servlet applications?▼

Yes, it detects jsp-legacy stacks via web.xml, .jsp files, and commons-fileupload usage. It checks whether FileValidator.validate() precedes transferTo() calls and whether upload paths stay outside the web root.

Why does the scanner report candidates instead of confirmed vulnerabilities?▼

Static patterns alone cannot tell whether validation is encapsulated in shared handlers like FileUtils.validateFile(). The scanner intentionally collects broad candidates, and AI verification reads the surrounding code and config files to confirm or dismiss each finding.

When should I not use this file upload scanning skill?▼

Skip it for pure APIs with no file upload functionality, or when the concern is download path validation, which belongs to path traversal detection instead. It targets upload-side CWE-434 risks only.