Skip to main content

input-validation-and-sanitization

Use this skill when implementing any endpoint, form handler, CLI tool, or function that accepts external input. Validate and sanitize all untrusted data before processing — never assume input is safe.

Informações da origem

Repositório
aiming-lab/MetaClaw
Última atividade na origem
10 de março de 2026 às 18:04
Idioma detectado do SKILL.md
inglês
Estrelas
3.456
Forks
450

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
input-validation-and-sanitization
description
Use this skill when implementing any endpoint, form handler, CLI tool, or function that accepts external input. Validate and sanitize all untrusted data before processing — never assume input is safe.
category
security
# Input Validation and Sanitization **Validation principles:** - Validate at the system boundary (API layer, form handler) — not deep in business logic. - Validate type, range, length, and format explicitly. - Reject unexpected input by default (allowlist > denylist). **SQL injection prevention:** Always use parameterized queries or an ORM. **XSS prevention:** Escape HTML output; use Content-Security-Policy headers; avoid `innerHTML` with user data. **Path traversal prevention:** Resolve paths to canonical form and verify they are under the expected directory. ```python import os base = '/allowed/dir' canonical = os.path.realpath(os.path.join(base, user_input)) assert canonical.startswith(base + os.sep) ```
Ver no GitHub