marketplace/bundles/pm-dev-frontend/skills/javascript-security/SKILL.md
Use when reviewing or hardening JavaScript security — DOM trust boundaries, XSS sinks (innerHTML/outerHTML/insertAdjacentHTML), safe text rendering, sanitization (DOMPurify), and Trusted Types. The focused JavaScript security surface resolved via skills_by_profile.security; a thin pointer that delegates cross-cutting foundations upward to plan-marshall:persona-security-expert.
npx skillsauth add cuioss/plan-marshall javascript-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
REFERENCE MODE: This skill provides reference material for JavaScript security review and hardening. Load specific standards on-demand based on current task. Do not load all standards at once.
Execution mode: Reference library; load standards on-demand for JavaScript security review and hardening tasks.
Prohibited actions:
innerHTML, outerHTML, or insertAdjacentHTML — these parse and execute injected markupConstraints:
textContent, createElement + textContent)Activate when:
textContent over innerHTMLinnerHTML/outerHTML/insertAdjacentHTML usagerequire-trusted-types-for 'script' via CSPLoad progressively based on current task. Never load all standards at once.
Read: ../javascript/standards/modern-patterns.md
Load the DOM Trust Boundaries / XSS section. The hazard is API-specific — properties that parse their argument as HTML execute embedded markup, while properties that treat their argument as text do not:
| API | Treatment | Safety |
|-----|-----------|--------|
| textContent | text | safe |
| createElement + textContent | text | safe (use when building structure) |
| innerHTML / outerHTML | HTML-parsing | XSS sink |
| insertAdjacentHTML | HTML-parsing | XSS sink |
| DOMPurify.sanitize(html) | allow-list sanitizer | safe when HTML output is unavoidable |
Trusted Types (require-trusted-types-for 'script' via Content-Security-Policy) turn the boundary into a runtime guarantee where the platform supports it.
| Surface | Home |
|---------|------|
| DOM trust boundaries, XSS sinks, sanitization, Trusted Types | ../javascript/standards/modern-patterns.md (DOM Trust Boundaries / XSS section) |
| Cross-cutting OWASP / STRIDE / trust-boundary / secure-design foundations | Skill: plan-marshall:persona-security-expert |
This skill is a thin pointer: the DOM-sink taxonomy above is genuinely runtime-specific (which browser APIs parse their argument as HTML), but the conceptual why lives in the centralized plan-marshall:persona-security-expert sub-documents. Load the matching foundation, then return here for the DOM mechanics — there is no content duplication:
| JS/DOM mechanic (here) | Centralized foundation (there) |
|------------------------|-------------------------------|
| The DOM as a trust boundary; the safe-default text sink; why allow-list sanitization beats deny-list filtering | input-validation-trust-boundaries.md |
| The XSS sinks mapped to a recognized risk category (A03 Injection / XSS) | owasp-top-ten.md |
| Why the text-treating sink is the secure default and Trusted Types/CSP harden by default | secure-design-principles.md |
| The Content-Security-Policy directives and require-trusted-types-for 'script' header that back the DOM Trusted Types mechanic | owasp-top-ten.md — Security Headers and Content Security Policy |
plan-marshall:persona-security-expert — Cross-cutting security review identity and authoritative home for OWASP Top 10, STRIDE, secrets, secure logging, trust boundaries, authn/authz, and secure-design principlespm-dev-frontend:javascript — Core JavaScript development standards (the DOM-trust/XSS content referenced above lives under its standards/ directory)pm-dev-frontend:jest-testing — Testing security-relevant DOM renderingdevelopment
Domain-owned OpenRewrite log-line finding parser for the java-cui domain — parses the
development
Domain-owned OpenRewrite marker detection for the java-cui domain — scans Java/Kotlin sources for cui-rewrite TODO markers, categorizes them by recipe, and fails the gate on any detected marker
development
Operator control surface for the marshalld build server — enrol/drop a project in the machine-global registry (the opt-in enable signal and anti-laundering wall), manage the daemon lifecycle (start, stop, drain, status, install, upgrade) version-pinned to the verified bundle copy, and inspect the daemon's per-project interaction-audit log (read-only)
tools
The tiny build-consumption client for the marshalld build server — submit a build job, bounded long-poll for its result, ping the daemon identity, and preflight registry-plus-liveness in one call; consumption only, never provisioning or enrolment