React 19
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
2prompts
- JavaScript ES2026102 lines · 3.1K tokens
- React 1948 lines · 1.4K tokens
Total150 lines · 4.5K tokens
CWE Coverage
- 20
- 79
- 89
- 95
- 117
- 201
- 208
- 209
- 306
- 323
- 338
- 346
- 347
- 352
- 362
- 459
- 471
- 488
- 494
- 502
- 522
- 524
- 602
- 639
- 770
- 807
- 829
- 838
- 862
- 915
- 916
- 918
- 922
- 943
- 1004
- 1321
- 1333
Prompt Preview
Apply the JavaScript ES2026 baseline first. These rules cover React 19.
Rendering and HTML
- Render untrusted values as JSX text or inert string props such as
title; string URL or HTML props still need validation or sanitization. - Avoid
dangerouslySetInnerHTML. For required rich HTML, sanitize once with a maintained allowlist sanitizer and pass it only as{__html: sanitized}at the reviewed sink; never concatenate after sanitizing or treat raw API responses as trusted markup. - Keep untrusted values out of inline script/style text, event-handler strings, and raw SVG or MathML.
- Pass a per-response CSP nonce to server streaming via the
nonceoption; Trusted Types enforcement alone doesn't makedangerouslySetInnerHTMLsafe. - Under
require-trusted-types-for 'script', check your minor: 19.3.0+ passesTrustedHTMLandTrustedScriptURLto DOM attributes unconverted, while 19.0 through 19.2 stringify them. On those minors, test each attribute sink under enforcement; never fix violations with a pass-through default policy.
URLs, props, and components
- Parse and allowlist URL schemes and origins before assigning user-derived navigation, image, iframe, or form targets.
- Never spread untrusted objects into DOM elements or privileged components, which can set unexpected attributes and handlers; map user-selected components and variants through an exact registry, not dynamic imports or property lookup.
- Keep secrets and authorization decisions out of client component props and public build-time variables; treat third-party escape hatches and