input-validation

Validates, sanitizes, and encodes user inputs to prevent injection attacks across web forms and APIs.

235|56|Updated Aug 1, 2015
One-click install
npx skills add https://github.com/Hack23/cia --skill input-validation-hack23
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-validation
Source: https://github.com/Hack23/cia/tree/main/.github/skills/input-validation
Command: npx skills add https://github.com/Hack23/cia --skill input-validation-hack23

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to validating, sanitizing, and encoding all user inputs to prevent injection attacks, data corruption, and unsafe rendering.

Core Features & Use Cases

  • Defense-in-depth: Multi-layer validation across client, server, service, and database layers.
  • Custom validators: Implement domain-specific checks (e.g., Swedish Personal ID) to enforce business rules.
  • Sanitization & encoding: Centralized HTML/JS encoding and input sanitization to prevent XSS and data leakage.
  • Secure data handling: Use parameterized queries and safe file upload validation to defend against injection and file-based threats.

Quick Start

Install and wire the InputSanitizer into your service; run a quick validation flow against representative inputs to observe sanitized outputs.

Frequently Asked Questions about input-validation

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

FAQPage Schema
How do I prevent XSS and SQL injection attacks in Java web applications?

To prevent XSS and SQL injection in Java, you validate, sanitize, and encode all user inputs using multi-layer validation, allowlist patterns, and parameterized queries. This approach enforces secure input handling across web forms and APIs.

What is the best way to implement defense-in-depth input validation?

Defense-in-depth input validation applies multi-layer checks across client, server, service, and database layers. By combining centralized HTML/JS encoding, allowlist-based patterns, and safe file handling, it prevents data corruption and unsafe rendering.

How do I create custom validators for domain-specific input validation?

You create custom validators to enforce specific business rules, such as checking a Swedish Personal ID. These domain-specific checks integrate into the broader input sanitization flow to ensure only valid data enters your system.

How do I sanitize file uploads to prevent command injection?

To sanitize file uploads and prevent command injection, apply safe file upload validation alongside standard input sanitization. This ensures uploaded files are thoroughly checked before processing, defending against file-based threats.

Does OWASP compliance require allowlist-based input validation?

OWASP compliance strongly recommends allowlist-based input validation to prevent injection attacks. Using strict allowlist patterns ensures only explicitly approved data formats are accepted, rejecting potentially malicious inputs before processing.

How do I wire an InputSanitizer into a Java service?

To wire an InputSanitizer into a Java service, install the component and run a quick validation flow against representative inputs. This allows you to observe sanitized outputs and verify that encoding and sanitization rules apply correctly.