hardening-file-uploads

Validate MIME types, scan for malware, and isolate file uploads.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/somachak/claude-code-skills-db --skill hardening-file-uploads
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hardening-file-uploads
Source: https://github.com/somachak/claude-code-skills-db/tree/main/skills/backend/hardening-file-uploads
Command: npx skills add https://github.com/somachak/claude-code-skills-db --skill hardening-file-uploads

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

File upload endpoints are frequent vectors for security breaches, enabling unsafe handling of user-provided content.

Core Features & Use Cases

  • MIME validation & sanitization: Enforce allowed types, prevent path traversal, and sanitize names.
  • Malware scanning & storage isolation: Integrate antivirus checks and store uploads outside the web root.
  • Post-processing safety: Ensure secure serving, content-type trust management, and safe downstream processing.

Quick Start

Configure your backend to validate MIME types, sanitize filenames, scan uploads for malware, and store files outside the web root before processing.

Frequently Asked Questions about hardening-file-uploads

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

FAQPage Schema
How do I secure file uploads to prevent security breaches on my API endpoint?

Secure file uploads by enforcing MIME validation, sanitizing filenames to prevent path traversal, scanning for malware, and storing files outside the web root. This mitigates risks from unsafe user-provided content on API endpoints and web services.

What is the best way to validate MIME types for user-uploaded media and documents?

Validating MIME types requires enforcing an allowlist of expected types and rejecting disallowed content before processing. This ensures only safe media and documents are accepted from user uploads across API endpoints and mobile apps.

Do I need malware scanning for accepting user-uploaded avatars and documents?

Yes, malware scanning is required to identify malicious content in user-uploaded avatars and documents. Integrating antivirus checks prevents compromised files from entering your system during file upload processing.

How does storage isolation protect against file upload vulnerabilities?

Storage isolation protects against file upload vulnerabilities by storing uploads outside the web root. This prevents direct execution of malicious scripts and ensures URL-safe serving of user-provided content.

Why does serving user-uploaded content require content-type trust management?

Serving user-uploaded content requires content-type trust management to prevent browsers from interpreting files as executable scripts. This post-processing safety ensures secure downstream processing and robust error handling.