frontend-security-coder
Expert in secure frontend coding practices specializing in XSS prevention, output sanitization, and client-side security patterns. Use PROACTIVELY for frontend security implementations or client-side security code reviews.
Author
Category
Development ToolsInstall
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
frontend-security-coder - Front-End Security Coding Expert
Skills Overview
A front-end security coding expert focused on hands-on guidance for XSS protection, output sanitization, and client-side security patterns.
Suitable Scenarios
1. Front-End Security Development and Implementation
When you need to write secure front-end code, use this skill to get practical guidance. This includes concrete coding tasks such as secure DOM manipulation, user input validation, Content Security Policy configuration, and third-party script integration.
2. Front-End Security Code Review
When you need to assess the security of existing front-end code, use this skill for professional evaluation. Focus on identifying client-side security issues such as XSS vulnerabilities, unsafe DOM manipulation, and missing input validation.
3. Front-End Security Architecture Design
When you need to design a front-end security solution, use this skill to obtain architecture recommendations. This includes architecture-level security considerations such as CSP policy design, authentication storage strategy, secure redirect handling, and clickjacking protection.
Core Functions
1. XSS Protection and Secure DOM Manipulation
Provide comprehensive XSS protection solutions, including secure DOM manipulation (textContent vs. innerHTML), dynamic content sanitization (DOMPurify integration), context-aware encoding, template safety, and secure rendering of user-generated content. Ensure that all dynamic content is properly validated and sanitized.
2. Content Security Policy (CSP) Configuration
A complete CSP implementation plan covering CSP header configuration, script source restrictions (nonce/hash-based), removal of inline scripts, stylesheet source control, violation report collection, and progressive CSP deployment. Help you effectively prevent script injection while maintaining functionality.
3. Comprehensive Client-Side Security Hardening
Cover multiple client-side security scenarios: input validation and sanitization, safe CSS handling, clickjacking protection, secure redirects and navigation, authentication and session management, browser security features (SRI, Trusted Types), third-party integration security, and PWA security.
Common Questions
What types of front-end XSS attacks are there? How can they be mitigated?
XSS attacks mainly fall into three categories:
Mitigation methods:
textContent instead of innerHTMLdocument.writeHow do I configure a Content Security Policy (CSP)?
CSP configuration steps:
Content-Security-Policy response headerContent-Security-Policy: default-src 'self'; script-src 'self' 'nonce-random-value'; style-src 'self' 'nonce-random-value'<script nonce="random-value">...</script>Content-Security-Policy-Report-OnlyContent-Security-Policy-Report-Only: default-src 'self'; report-uri /csp-violationWhat is the difference between front-end secure coding and security auditing?
frontend-security-coder (front-end security coding):
security-auditor (security auditing):
In short: frontend-security-coder is “writing secure code hands-on,” while security-auditor is “checking the security posture.” If you need to implement front-end security features, use frontend-security-coder; if you need comprehensive security assessment or auditing, use security-auditor.