klytos-escape-and-sanitization

Escape and sanitize user input and output to prevent XSS and injection.

12|2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/joseconti/klytos --skill klytos-escape-and-sanitization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: klytos-escape-and-sanitization
Source: https://github.com/joseconti/klytos/tree/main/.claude/skills/klytos-escape-and-sanitization
Command: npx skills add https://github.com/joseconti/klytos --skill klytos-escape-and-sanitization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Escape and sanitize data to prevent XSS, data leakage, and injection in web applications, templates, and forms.

Core Features & Use Cases

  • Output escaping functions: klytos_esc_html, klytos_esc_attr, klytos_esc_url, klytos_esc_js, klytos_esc_textarea.
  • Input sanitization functions: klytos_sanitize_text, klytos_sanitize_email, klytos_sanitize_url, klytos_sanitize_filename, klytos_sanitize_key, klytos_sanitize_html, klytos_sanitize_int, klytos_sanitize_float.
  • HTML filtering (KSES): klytos_kses, klytos_kses_post.
  • CSRF protection: klytos_csrf_field, klytos_verify_csrf.
  • Validation helpers and secure form examples to demonstrate end-to-end protection.

Quick Start

Use this skill to implement end-to-end escaping, sanitization, and CSRF protection in your web forms.

Frequently Asked Questions about klytos-escape-and-sanitization

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

FAQPage Schema
How do I sanitize user input and escape output to prevent XSS in web applications?

To prevent XSS, sanitize user input and escape output using dedicated helper functions for text, HTML, URLs, and attributes, ensuring untrusted data is neutralized before rendering or processing in web forms.

Can I use KSES filtering to restrict allowed HTML tags and attributes in CMS content?

Yes, KSES filtering restricts allowed HTML tags and attributes in CMS content by passing user-submitted HTML through strict content filtering functions to strip malicious code while preserving safe markup.

How do I add CSRF protection and verification to web forms?

Adding CSRF protection and verification to web forms requires rendering a hidden CSRF token field in the form and validating that token on the server side upon submission to block cross-site request forgery attacks.

What is the difference between output escaping and input sanitization for web security?

Output escaping neutralizes malicious scripts before rendering data in the browser, while input sanitization cleans and validates user-submitted data upon receipt, forming a comprehensive defense against XSS and injection vulnerabilities.

Does this Skill include secure form examples for end-to-end protection?

Yes, the Skill includes secure form examples that demonstrate end-to-end protection by combining input sanitization, output escaping, KSES content filtering, and CSRF verification helper functions within CMS contexts.