/prodsec-skills:react-securityfrom prodsec-skills
Enforce XSS prevention and secure rendering in React applications. Use when building, reviewing, or auditing React components, especially those that render user-controlled data or use server-side rendering.
Ships in prodsec-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
React escapes values rendered via JSX data binding by default, but several patterns can reintroduce XSS vulnerabilities. This skill covers the most common pitfalls.
React automatically escapes values inside curly braces when rendering text content. This protection does not apply to HTML attributes.
Safe -- text content is escaped:
<div>{userData}</div>
Unsafe -- attribute values are not automatically escaped:
<form action={userData}>...</form>
Always validate or sanitize values placed in HTML attributes, especially href, src, action, and event handler attributes.
Never pass unsanitized data to dangerouslySetInnerHTML. Always sanitize with a library like DOMPurify before rendering raw HTML.
Safe:
import DOMPurify from "dompurify";
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(data) }} />
Unsafe:
this.myRef.current.innerHTML = attackerControlledValue;
Direct DOM manipulation via refs bypasses React's escaping entirely.
URLs can contain executable content via javascript: protocol URIs. Validate that URLs use http: or https: before rendering them.
Safe:
function validateURL(url) {
const parsed = new URL(url);
return ["https:", "http:"].includes(parsed.protocol);
}
<a href={validateURL(url) ? url : ""}>Click here</a>
Unsafe:
<a href={attackerControlled}>Click here</a>
ReactDOMServer.renderToString() and ReactDOMServer.renderToStaticMarkup() provide automatic content escaping for data bound through JSX. Do not concatenate unsanitized data with their output.
Unsafe SSR pattern:
const html = ReactDOMServer.renderToString(<App />) + unsanitizedData;
When embedding serialized state in SSR HTML, escape HTML-significant characters to prevent script injection via closing </script> tags.
Safe:
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, "\\u003c")}
{} binding, not string concatenationdangerouslySetInnerHTML is only used with DOMPurify-sanitized contentref.current.innerHTMLhref and src values are validated for http:/https: protocol< as \u003ceval(), Function(), or inline event handlersWhat SKILL.md sets; muted values are Claude Code's defaults
130 skills in this plugin
/address-sanitizerAddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
/admin-interface-securitySecure the administrative interface of model registries. Use when building, deploying, or reviewing model registry access controls and admin interfaces./aflppAFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.
/agentic-actions-auditorAudits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations./agent-identityEnforce that AI agents have their own identity separate from human users. Use when designing, building, or reviewing agent identity management, agent authentication, or agent permission models./agent-to-agent-authEnforce SPIFFE/SPIRE plus mTLS for agent-to-agent communication. Use when designing, building, or reviewing authentication between AI agents or multi-agent systems.npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skillsOther plugins' skills for the same job