Skip to content

forcedotcom/sf-skills / plugins/builder/experience-lwc/skills/experience-lwc-security-validate

experience-lwc-security-validate

Flagged

Use this skill as THE specialized Lightning Web Security (LWS) validator for a Lightning Web Component bundle (`.js`, `.ts`, `.html`, `.css`, `.js-meta.xml`) — the canonical LWS/Product-Security review for LWCs, NOT a generic code-security pass. It produces either a severity-ranked finding list with code-level remediations or a SARIF 2.1.0 JSON score report keyed by the `lws-001`…`lws-023b` rule catalog. TRIGGER when the user asks to review, audit, or check an LWC component for LWS compliance issues and recommend fixes, score a component's LWS/security compliance, find dangerous DOM APIs or blocked sinks (`eval`, `Function`, `document.write`, `innerHTML`, `document.createElement('script')`, global-scope assignment to `window`/`globalThis`, unsafe URL schemes), or emit a SARIF security report. DO NOT TRIGGER for generic non-LWC security review, for building a new LWC (use experience-lwc-generate), accessibility (WCAG 2.2), RTL/i18n, or Apex/Aura/server-side review.

FileKindSize
SKILL.mdskill md10.4 KB
examples/review-report.mdmarkdown174 B
examples/score-report.sarif.jsonconfig1.0 KB
references/lws-security-expert.mdmarkdown56.1 KB
references/security-analysis.mdmarkdown19.5 KB
scripts/check-lwc-import.shexecutablescript5.5 KB
scripts/validate-sarif.shexecutablescript4.2 KB

examples/score-report.sarif.json

View on GitHub
{
  "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/schemas/sarif-schema-2.1.0.json",
  "version": "2.1.0",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "experience-lwc-security-validate",
          "informationUri": "https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.security_lws_intro",
          "rules": [
            { "id": "lws-001", "shortDescription": { "text": "document.createProcessingInstruction" } }
          ]
        }
      },
      "results": [
        {
          "ruleId": "lws-001",
          "level": "error",
          "message": { "text": "Usage of document.createProcessingInstruction creates XML injection vulnerabilities enabling XSS attacks" },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": { "uri": "force-app/main/default/lwc/myCmp/myCmp.js" },
                "region": { "startLine": 42, "startColumn": 1 }
              }
            }
          ]
        }
      ]
    }
  ]
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall