input-sanitization

Validate and sanitize server-side web input against injection and XSS threats.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill input-sanitization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-sanitization
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skill-library/stack/security/input-sanitization
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill input-sanitization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dompurify, file-type, jsdom, multer, zod, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill protects your web applications by ensuring all data received from users or external sources is validated and sanitized, preventing security vulnerabilities like injection attacks and data corruption.

Core Features & Use Cases

  • Server-side Validation: Enforces data integrity as the single source of truth.
  • Schema Validation: Utilizes libraries like Zod, Joi, or Pydantic for robust data structure checks.
  • Injection Prevention: Guards against SQL, command, and path traversal attacks.
  • XSS Prevention: Sanitizes HTML input to prevent cross-site scripting.
  • File Upload Security: Validates file types, sizes, and content.
  • Use Case: When accepting user registration data, use this Skill to validate email format, password strength, and display name length on the server before storing it.

Quick Start

Use the input-sanitization skill to validate incoming user data against a predefined Zod schema.

Frequently Asked Questions about input-sanitization

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

FAQPage Schema
How do I prevent SQL injection and XSS vulnerabilities in my web application?

Server-side input validation and sanitization prevent SQL injection and XSS by enforcing schema validation, parameterized queries, and HTML sanitization to strip malicious payloads before processing user data.

How do I validate user registration data on the server before storing it?

Server-side validation validates user registration data by checking email format, password strength, and display name length against a predefined schema using Zod before any data reaches your database.

What's the best way to secure file uploads against malicious content?

File upload security validates file types, sizes, and content using libraries like multer and file-type to enforce content-type checks, preventing malicious files from entering your server environment.

Does Zod work with server-side sanitization for path traversal prevention?

Zod enables server-side sanitization for path traversal prevention by enforcing strict schema validation on incoming data, ensuring URL and path inputs conform to expected formats before processing.

How does HTML sanitization stop cross-site scripting attacks?

HTML sanitization stops cross-site scripting attacks by using DOMPurify with jsdom to strip dangerous scripts and tags from user input, ensuring only safe content renders in the browser.

When should I not rely on client-side validation alone for injection prevention?

Client-side validation alone is insufficient for injection prevention because attackers can bypass it; server-side validation must act as the single source of truth to guard against SQL, command, and path traversal attacks.