Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Brief Svelte/SvelteKit security notes: {@html} sinks, CSP, SSR XSS, client store secret hygiene, and hooks.server auth patterns. Use when reviewing or hardening SvelteKit apps, {@html} rich text, handle/hooks session guards, PUBLIC_ env leakage, or Svelte SSR markup escaping — authorized/owned only.
Svelte Security Notes
Defensive notes for Svelte / SvelteKit you own or may harden. Default
interpolation is safe; risk concentrates on {@html}, SSR-injected
markup, client-visible secrets, and auth only in the UI.
When To Use
Reviewing Svelte/SvelteKit for XSS, CSP, or session/auth wiring
{@html ...} or custom elements rendering untrusted markup
SSR/hydration paths that inject HTML, attributes, or JSON into documents
Secrets or tokens in writable stores, $page.data, or non-PRIVATE_ env
hooks.server.ts / handle / locals auth and route protection patterns
Do not use as primary for general XSS methodology (xss-cross-site-scripting),
sanitizer library choice (html-sanitizer-selection), JWT crypto abuse
(api-auth-and-jwt-abuse), or generic code quality (code-quality-standards).
Precedence: Follow existing handle and layout load guards. Flag
{@html} on user content, secrets in PUBLIC_ env, or auth checks only in
client components.
Workflow
Map trust boundaries — browser vs server load / actions / +server;
what reaches data, stores, and HTML. Prefer server-only for secrets and
authorization decisions.
Escaping vs {@html} — {value} / attributes auto-escape in Svelte.
Treat {@html html} as an intentional raw sink: allow only after server-side
sanitize (html-sanitizer-selection); never pipe request/DB strings straight
in. Prefer plain text or structured components over rich HTML.
SSR XSS — untrusted data in SSR HTML, <script> JSON blobs, style,
event-handler attrs, or srcdoc bypasses “client-only” assumptions. Sanitize
or encode before first paint; re-check hydrated markup matches policy.
CSP — prefer nonces/hashes via SvelteKit csp / response headers; tight
script-src / object-src / base-uri; avoid unsafe-inline without nonce.
CSP is defense-in-depth, not a substitute for removing {@html} abuse.
Bypass research → content-security-policy-bypass.
Store / env secrets — never put API keys, session tokens, or service
credentials in writable stores, localStorage, or non-httpOnly cookies.
Use PRIVATE_ + $env/static/private (or dynamic private) on the server only;
PUBLIC_ is always client-visible. Strip secrets from PageData / serialize.
hooks.server auth — centralize session resolve in handle; set
event.locals.user (typed in app.d.ts); protect with server load, layout
guards, and +server/actions — not if (!user) goto alone. Prefer httpOnly
session cookies; regenerate on login; validate origin/CSRF for cookie mutations.
Verify — guest vs auth routes (401/302/403); {@html} fixtures; CSP
report-only then enforce; confirm no secrets in client bundles or HTML.
Good: server sanitize → trusted fragment → {@html safe}; session in
httpOnly cookie; locals.user set in handle; private env only in server modules.
Bad:{@html comment.body} raw; PUBLIC_API_SECRET; JWT in localStorage
or a store synced to it; auth only inside a client +page.svelte.
Routing
Situation
Primary
Helper
SvelteKit {@html}, CSP, SSR XSS, stores, hooks.server