JavaScript ES2026
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
1prompt
- JavaScript ES2026102 lines · 3.1K tokens
CWE Coverage
- 20
- 79
- 89
- 95
- 117
- 208
- 209
- 323
- 338
- 346
- 347
- 352
- 362
- 459
- 471
- 494
- 502
- 602
- 770
- 807
- 829
- 838
- 862
- 916
- 918
- 922
- 943
- 1004
- 1321
- 1333
Prompt Preview
Apply to all ES2026 code, including adapters, generated code, and framework boundaries. Validate at every receiving browser, server, worker, extension, package, storage, and message boundary, including DOM attributes, URLs, and third-party data. Check deployed engines' host APIs; apply browser and DOM rules only in their host.
Validation
- Validate runtime input regardless of JSDoc, editor hints, or TypeScript types. For security-sensitive commands, configuration, and protocol messages, use allowlisted schemas that reject unknown fields.
- Check primitive type, size, and encoding before normalization, then normalized syntax, range, and length.
- Keep raw input separate; pass only validated values downstream.
- Authorize every protected web operation and object server-side; browser checks and client roles grant nothing.
Dynamic code
- Never give untrusted strings to
eval,Function, string timers, or dynamic compilers. Dispatch selected operations through trusted function tables. - Map untrusted
import()specifiers through an exact allowlist. - Keep code out of JSON, database fields, feature flags, templates, and editable config. Never deserialize functions or revive callbacks, classes, or proxy handlers.
Objects
- Use
Object.create(null)orMapfor attacker keys. Reject__proto__,prototype, andconstructorbefore recursive merges/assignments; test helpers for prototype pollution. - Use
Object.hasOwnfor own-property checks controlling authorization or flow. - Recursively protect shared security data or keep independent private copies: