form-security

Secure web forms with autocomplete, CSRF protection, and input sanitization.

8|3|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/Bbeierle12/Skill-MCP-Claude --skill form-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: form-security
Source: https://github.com/Bbeierle12/Skill-MCP-Claude/tree/main/skills/form-security
Command: npx skills add https://github.com/Bbeierle12/Skill-MCP-Claude --skill form-security

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Web forms, especially those handling sensitive data, are frequent targets for security vulnerabilities like CSRF and XSS, and often fail to integrate with password managers, leading to poor user experience and weak passwords. This Skill provides essential patterns to build secure, compliant, and user-friendly forms, protecting both your users and your application.

Core Features & Use Cases

  • Autocomplete Attributes: Guides on using correct autocomplete values for seamless integration with password managers, improving user experience and password strength.
  • CSRF Protection: Implements token-based protection and SameSite cookies to prevent Cross-Site Request Forgery attacks, safeguarding against malicious requests.
  • XSS Prevention: Provides patterns for input sanitization and output encoding to guard against Cross-Site Scripting vulnerabilities, preventing code injection.
  • Secure Password Handling: Best practices for password fields, including allowing paste, visibility toggles, and never logging sensitive data, enhancing user security.
  • Use Case: A developer is building a new login and registration system. This skill provides the essential patterns for autocomplete="current-password" and autocomplete="new-password", CSRF token implementation, and input sanitization to ensure the forms are secure and user-friendly, reducing security risks and development time.

Quick Start

Generate a secure React login form with email and password fields, ensuring correct autocomplete attributes, CSRF protection, and XSS prevention.

Frequently Asked Questions about form-security

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

FAQPage Schema
How do I prevent CSRF attacks in web forms?

CSRF protection uses token-based validation and SameSite cookies to prevent Cross-Site Request Forgery. Include a unique token with each form submission and validate it server-side; set SameSite=Strict or Lax on session cookies to block cross-site requests from executing malicious form actions.

What autocomplete attributes should I use for password fields?

Use autocomplete="current-password" for login forms and autocomplete="new-password" for registration or password-change forms. These attributes enable password manager integration, improve user experience, and encourage stronger passwords by allowing secure autofill.

How do I prevent XSS vulnerabilities in form inputs?

XSS prevention combines input sanitization and output encoding. Sanitize user input by removing or escaping dangerous characters and HTML tags; encode output when displaying user data in HTML context to prevent injected scripts from executing.

Can I make forms compatible with password managers?

Yes. Set correct autocomplete attributes, use standard form input elements with name and id attributes, avoid JavaScript that disrupts autofill, and allow paste in password fields. These practices ensure password managers can securely autofill credentials without user friction.

What input sanitization techniques work for sensitive data forms?

Input sanitization for payment and authentication forms removes or encodes potentially harmful content before processing. Use allowlists to validate expected formats (email, phone, card numbers), escape special characters, and never log sensitive data like passwords or card details.

Why do forms fail password manager integration?

Forms fail integration when missing proper autocomplete attributes, using non-standard input elements, blocking paste functionality, or employing JavaScript that interferes with autofill. Password managers rely on semantic HTML and standard attributes to detect and populate credential fields reliably.