Global Validation

Enforce allowlist-based input validation and sanitization across client and server.

6|1|Updated Nov 12, 2022
One-click install
npx skills add https://github.com/coreyja/coreyja.com --skill global-validation-coreyja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Validation
Source: https://github.com/coreyja/coreyja.com/tree/main/.claude/skills/global-validation
Command: npx skills add https://github.com/coreyja/coreyja.com --skill global-validation-coreyja

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill protects applications from security vulnerabilities and ensures data integrity by enforcing comprehensive input validation on both client and server sides.

Core Features & Use Cases

  • Secure Input Handling: Implements allowlists, type checking, and sanitization to prevent injection attacks (SQL, XSS, command injection).
  • Comprehensive Data Checks: Validates data types, formats, ranges, and business rules for all external input.
  • Use Case: When creating a user registration form, use this skill to ensure both client-side and server-side validation for email format, password strength, and prevention of malicious script injection.

Quick Start

Apply the Global Validation skill to the new user profile update endpoint, ensuring all incoming data is sanitized, type-checked, and validated against business rules before being processed.

Frequently Asked Questions about Global Validation

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

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

Prevent SQL injection and XSS by implementing global input validation with allowlists, type checking, and sanitization on both client and server. Server-side validation is mandatory; client-side validation improves UX but cannot be trusted alone. This enforces that all external data—forms, APIs, external sources—meets strict format and content rules before processing.

What's the best way to validate user input across frontend and backend?

Implement coordinated validation: client-side checks provide immediate UX feedback, but server-side validation is the security layer. Validate data types, formats (emails, phone numbers, URLs), ranges, required fields, and business rules. Use allowlists to accept only known-good patterns and sanitize to block injection payloads.

Do I need to validate data from external APIs and third-party sources?

Yes. Global input validation covers user forms, API endpoints, and external data sources equally. Treat all incoming data as untrusted, regardless of source. Apply the same allowlist-based type checking, format validation, and sanitization to prevent injection attacks and ensure data integrity.

Can I use client-side validation alone to protect against injection attacks?

No. Client-side validation enhances user experience but is not a security boundary—attackers can bypass it. Server-side validation is mandatory and must independently enforce allowlists, type checks, format rules, and sanitization to prevent SQL injection, XSS, and command injection.

What validation checks should I apply to form inputs?

Apply type checking (ensure strings, numbers, booleans match expected types), format validation (emails, phone numbers, URLs against strict patterns), range checks (length, numeric bounds), required-field enforcement, and sanitization to remove or escape special characters. Use allowlists to accept only explicitly permitted values.

How do I validate password strength and email formats securely?

Validate email format against RFC standards server-side using strict regex or parsing libraries. For passwords, enforce length minimums, character-set rules, and business requirements server-side. Sanitize both inputs to remove injection vectors. Reject any input failing allowlist or format rules before storage.