smithery/ngxtm

React Security

Security practices for React (XSS, Auth, Dependencies).

Installation

$ npx skills add smithery/ngxtm --skill react-security

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/ngxtm · top by installs.

npx skills add smithery/ngxtm

Browse all from smithery/ngxtm

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
labels
["react","security","xss","auth"]
triggers
{"files":["**\/*.tsx","**\/*.jsx"],"keywords":["dangerouslySetInnerHTML","token","auth","xss"]}

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,263 B
  • docs SUMMARY.md 77 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

React Security

Priority: P0 (CRITICAL)

Preventing vulnerabilities in client-side apps.

Implementation Guidelines

  • XSS: Avoid dangerouslySetInnerHTML. Sanitize via DOMPurify if needed.
  • URLs: Validate javascript: protocols in user links.
  • Auth: Store tokens in HttpOnly cookies. Avoid localStorage.
  • Deps: Run npm audit. Pin versions.
  • Secrets: Server-side only. No .env secrets in build.
  • CSP: Strict Content-Security-Policy headers.

Anti-Patterns

  • No eval(): RCE risk.
  • No Serialized State: Don't inject JSON into DOM without escaping.
  • No Client Logic for Permissions: Backend must validate.

Code

import DOMPurify from 'dompurify';

// Safe HTML Injection
function SafeHtml({ content }) {
  const clean = DOMPurify.sanitize(content);
  return <div dangerouslySetInnerHTML={{ __html: clean }} />;
}

// Bad Link Prevention
const safeUrl = url.startsWith('javascript:') ? '#' : url;
<a href={safeUrl}>Link</a>;