Web Frontend
134 items · source
Web Frontend & SSR
- Inventory Route Handlers.
- Inventory Proxy configuration.
- Verify authorization is enforced at the data-access layer/server boundary.
- Verify server-only modules cannot be imported into client bundles.
- Verify server secrets cannot cross the client boundary.
- Search generated JS bundles for secrets.
- Search source maps for secrets.
- Search
NEXT_PUBLIC_*variables for accidental sensitive information. - Verify server-only environment variables do not start with
NEXT_PUBLIC_. - Verify build-time environment variables do not leak credentials.
- Verify every protected route is covered by intended Proxy matchers.
- Verify matcher exclusions cannot bypass authorization.
- Verify
/apior route-handler paths are not accidentally excluded from required checks. - Verify static assets do not contain sensitive information.
- Verify alternate URL normalization cannot bypass protection.
- Verify encoded-path traversal cannot bypass route rules.
- Verify case normalization cannot bypass authorization.
- Verify trailing-slash behavior.
- Verify rewrite behavior.
- Verify redirect behavior.
- Verify open redirects.
- Verify host-header-derived URLs are validated.
- Verify proxy does not perform expensive database authorization checks on every request unless intentionally designed.
- Verify Proxy authentication state cannot be forged by modifying unsigned cookies.
- Verify authentication for every action.
- Verify authorization for every action.
- Verify input validation.
- Verify CSRF protection assumptions.
- Verify action arguments cannot manipulate trusted fields.
- Verify action results do not leak private data.
- Verify replay/idempotency requirements.
- Verify rate limits for expensive actions.
- Verify sensitive actions require recent authentication where required.
- Verify authentication.
- Verify authorization.
- Verify CORS.
- Verify CSRF where relevant.
- Verify input validation.
- Verify response caching.
- Verify rate limiting.
- Verify error handling.
- Verify SSRF controls.
- Verify file upload controls.
- Verify outbound calls.
- Verify secret handling.
- Review every use manually.
- Search for HTML rendering libraries.
- Search for Markdown-to-HTML rendering.
- Search for rich-text editors.
- Search for user-controlled URLs.
- Search for
javascript:URL possibilities. - Search for unsafe DOM APIs.
- Search for direct
innerHTML. - Search for
eval. - Search for
new Function. - Search for dynamically generated scripts.
- Verify user-generated HTML is sanitized.
- Verify sanitizer configuration is secure.
- Verify URL protocols are allowlisted.
- Verify SVG handling.
- Verify embedded iframe origins.
- Verify postMessage origin validation.
- Verify message event data validation.
- Verify window opener behavior.
- Verify OAuth/payment popup security.
- Verify DOM clobbering risks where relevant.
- Deploy a deliberate Content Security Policy.
- Review
script-src. - Review
style-src. - Review
img-src. - Review
connect-src. - Review
frame-src. - Review
object-src. - Review
base-uri. - Review
form-action. - Review
frame-ancestors. - Avoid
unsafe-evalunless justified. - Avoid
unsafe-inlinewhere possible. - Use nonces/hashes where appropriate.
- Verify CSP is actually delivered on production responses.
- Verify CSP differs appropriately between development and production.
- Verify third-party scripts are explicitly allowlisted.
- Verify analytics/ad/tracking scripts do not receive unnecessary sensitive data.
- Verify Subresource Integrity where suitable.
- Verify HSTS.
- Verify HSTS
includeSubDomainsandpreloadare enabled only after every subdomain serves valid HTTPS, withmax-ageramped up first — preload commits you for months and breaks any HTTP-only subdomain. - Verify
X-Content-Type-Options. - Verify
Referrer-Policy. - Verify clickjacking protection.
- Verify browser permissions policies.
- Verify HTML responses send
Cross-Origin-Opener-Policy: same-origin(orsame-origin-allow-popupswhere OAuth or payment popups need it) — without it any page that opens yours can probe its state across windows. - Verify authenticated endpoints reject cross-site subresource requests by checking
Sec-Fetch-SiteandSec-Fetch-Mode(allow same-origin, same-site,noneand top-level navigation) — a fetch-metadata policy stops cross-site leaks that cookie flags miss. - Search for JSONP endpoints (
callback=parameters,jsonp() and per-user generated JavaScript files, and verify none returns data that needs authorization — a cross-site<script>tag sends the user's cookies and reads the result. - Verify
Secure. - Verify
HttpOnlyfor sensitive cookies. - Verify appropriate
SameSite. - Verify cookie domain is as narrow as practical.
- Verify cookie path.
- Verify session cookies use the
__Host-prefix (Secure,Path=/, noDomain) so a sibling subdomain or network attacker cannot set or overwrite them; use__Secure-only where a cookie must span subdomains. - Measure the largest auth cookie the app writes (many roles, long JWT, chunked SSR cookies) and verify each stays under 4096 bytes and all of them under the proxy's header limit — browsers silently drop an oversized cookie and the user is logged out with no error.
- Verify session expiration.
- Verify session rotation after login.
- Verify session rotation after privilege changes.
- Verify session invalidation on logout.
- Verify logout sends
Clear-Site-Data: "cache", "storage"or the client wipes localStorage, sessionStorage and IndexedDB, so the next person on a shared device sees no cached account data. - Verify session fixation protection.
- Verify sensitive tokens are not stored in localStorage unnecessarily.
- Verify refresh tokens are not exposed to JavaScript unless explicitly required.
- Verify browser storage does not contain secrets that do not need to be there.
- Verify third-party scripts cannot read sensitive browser storage.
- Verify authenticated pages cannot be publicly cached.
- Verify per-user data cannot be cached as shared content.
- Verify route cache keys include identity where needed.
- Verify static generation does not bake sensitive data into public assets.
- Verify revalidation cannot publish private information.
- Verify server-side fetches do not leak authorization headers into caches/logs.
- Verify cross-user request context isolation.
- Verify data from one user cannot be reused for another user through memoization.
- Verify redirects do not leak sensitive URL parameters.
- Verify error pages do not expose server-side data.
- Pin production dependencies appropriately.
- Review direct dependencies.
- Review transitive dependencies.
- Run dependency vulnerability scanning.
- Run lockfile integrity checks.
- Verify package manager lockfile is committed.
- Verify postinstall scripts.
- Verify unexpected packages.
- Verify abandoned/high-risk packages.
- Verify image-processing packages.
- Verify authentication packages.
- Verify Markdown/HTML parsers.
- Verify URL parsers.
- Verify crypto libraries.
# Web Frontend ## Web Frontend & SSR * [ ] Inventory Route Handlers. * [ ] Inventory Proxy configuration. * [ ] Verify authorization is enforced at the data-access layer/server boundary. * [ ] Verify server-only modules cannot be imported into client bundles. * [ ] Verify server secrets cannot cross the client boundary. * [ ] Search generated JS bundles for secrets. * [ ] Search source maps for secrets. * [ ] Search `NEXT_PUBLIC_*` variables for accidental sensitive information. * [ ] Verify server-only environment variables do not start with `NEXT_PUBLIC_`. * [ ] Verify build-time environment variables do not leak credentials. * [ ] Verify every protected route is covered by intended Proxy matchers. * [ ] Verify matcher exclusions cannot bypass authorization. * [ ] Verify `/api` or route-handler paths are not accidentally excluded from required checks. * [ ] Verify static assets do not contain sensitive information. * [ ] Verify alternate URL normalization cannot bypass protection. * [ ] Verify encoded-path traversal cannot bypass route rules. * [ ] Verify case normalization cannot bypass authorization. * [ ] Verify trailing-slash behavior. * [ ] Verify rewrite behavior. * [ ] Verify redirect behavior. * [ ] Verify open redirects. * [ ] Verify host-header-derived URLs are validated. * [ ] Verify proxy does not perform expensive database authorization checks on every request unless intentionally designed. * [ ] Verify Proxy authentication state cannot be forged by modifying unsigned cookies. * [ ] Verify authentication for every action. * [ ] Verify authorization for every action. * [ ] Verify input validation. * [ ] Verify CSRF protection assumptions. * [ ] Verify action arguments cannot manipulate trusted fields. * [ ] Verify action results do not leak private data. * [ ] Verify replay/idempotency requirements. * [ ] Verify rate limits for expensive actions. * [ ] Verify sensitive actions require recent authentication where required. * [ ] Verify authentication. * [ ] Verify authorization. * [ ] Verify CORS. * [ ] Verify CSRF where relevant. * [ ] Verify input validation. * [ ] Verify response caching. * [ ] Verify rate limiting. * [ ] Verify error handling. * [ ] Verify SSRF controls. * [ ] Verify file upload controls. * [ ] Verify outbound calls. * [ ] Verify secret handling. * [ ] Review every use manually. * [ ] Search for HTML rendering libraries. * [ ] Search for Markdown-to-HTML rendering. * [ ] Search for rich-text editors. * [ ] Search for user-controlled URLs. * [ ] Search for `javascript:` URL possibilities. * [ ] Search for unsafe DOM APIs. * [ ] Search for direct `innerHTML`. * [ ] Search for `eval`. * [ ] Search for `new Function`. * [ ] Search for dynamically generated scripts. * [ ] Verify user-generated HTML is sanitized. * [ ] Verify sanitizer configuration is secure. * [ ] Verify URL protocols are allowlisted. * [ ] Verify SVG handling. * [ ] Verify embedded iframe origins. * [ ] Verify postMessage origin validation. * [ ] Verify message event data validation. * [ ] Verify window opener behavior. * [ ] Verify OAuth/payment popup security. * [ ] Verify DOM clobbering risks where relevant. * [ ] Deploy a deliberate Content Security Policy. * [ ] Review `script-src`. * [ ] Review `style-src`. * [ ] Review `img-src`. * [ ] Review `connect-src`. * [ ] Review `frame-src`. * [ ] Review `object-src`. * [ ] Review `base-uri`. * [ ] Review `form-action`. * [ ] Review `frame-ancestors`. * [ ] Avoid `unsafe-eval` unless justified. * [ ] Avoid `unsafe-inline` where possible. * [ ] Use nonces/hashes where appropriate. * [ ] Verify CSP is actually delivered on production responses. * [ ] Verify CSP differs appropriately between development and production. * [ ] Verify third-party scripts are explicitly allowlisted. * [ ] Verify analytics/ad/tracking scripts do not receive unnecessary sensitive data. * [ ] Verify Subresource Integrity where suitable. * [ ] Verify HSTS. * [ ] Verify HSTS `includeSubDomains` and `preload` are enabled only after every subdomain serves valid HTTPS, with `max-age` ramped up first — preload commits you for months and breaks any HTTP-only subdomain. * [ ] Verify `X-Content-Type-Options`. * [ ] Verify `Referrer-Policy`. * [ ] Verify clickjacking protection. * [ ] Verify browser permissions policies. * [ ] Verify HTML responses send `Cross-Origin-Opener-Policy: same-origin` (or `same-origin-allow-popups` where OAuth or payment popups need it) — without it any page that opens yours can probe its state across windows. * [ ] Verify authenticated endpoints reject cross-site subresource requests by checking `Sec-Fetch-Site` and `Sec-Fetch-Mode` (allow same-origin, same-site, `none` and top-level navigation) — a fetch-metadata policy stops cross-site leaks that cookie flags miss. * [ ] Search for JSONP endpoints (`callback=` parameters, `jsonp(`) and per-user generated JavaScript files, and verify none returns data that needs authorization — a cross-site `<script>` tag sends the user's cookies and reads the result. * [ ] Verify `Secure`. * [ ] Verify `HttpOnly` for sensitive cookies. * [ ] Verify appropriate `SameSite`. * [ ] Verify cookie domain is as narrow as practical. * [ ] Verify cookie path. * [ ] Verify session cookies use the `__Host-` prefix (Secure, `Path=/`, no `Domain`) so a sibling subdomain or network attacker cannot set or overwrite them; use `__Secure-` only where a cookie must span subdomains. * [ ] Measure the largest auth cookie the app writes (many roles, long JWT, chunked SSR cookies) and verify each stays under 4096 bytes and all of them under the proxy's header limit — browsers silently drop an oversized cookie and the user is logged out with no error. * [ ] Verify session expiration. * [ ] Verify session rotation after login. * [ ] Verify session rotation after privilege changes. * [ ] Verify session invalidation on logout. * [ ] Verify logout sends `Clear-Site-Data: "cache", "storage"` or the client wipes localStorage, sessionStorage and IndexedDB, so the next person on a shared device sees no cached account data. * [ ] Verify session fixation protection. * [ ] Verify sensitive tokens are not stored in localStorage unnecessarily. * [ ] Verify refresh tokens are not exposed to JavaScript unless explicitly required. * [ ] Verify browser storage does not contain secrets that do not need to be there. * [ ] Verify third-party scripts cannot read sensitive browser storage. * [ ] Verify authenticated pages cannot be publicly cached. * [ ] Verify per-user data cannot be cached as shared content. * [ ] Verify route cache keys include identity where needed. * [ ] Verify static generation does not bake sensitive data into public assets. * [ ] Verify revalidation cannot publish private information. * [ ] Verify server-side fetches do not leak authorization headers into caches/logs. * [ ] Verify cross-user request context isolation. * [ ] Verify data from one user cannot be reused for another user through memoization. * [ ] Verify redirects do not leak sensitive URL parameters. * [ ] Verify error pages do not expose server-side data. * [ ] Pin production dependencies appropriately. * [ ] Review direct dependencies. * [ ] Review transitive dependencies. * [ ] Run dependency vulnerability scanning. * [ ] Run lockfile integrity checks. * [ ] Verify package manager lockfile is committed. * [ ] Verify postinstall scripts. * [ ] Verify unexpected packages. * [ ] Verify abandoned/high-risk packages. * [ ] Verify image-processing packages. * [ ] Verify authentication packages. * [ ] Verify Markdown/HTML parsers. * [ ] Verify URL parsers. * [ ] Verify crypto libraries. 134 items · https://github.com/FarzamHabibi/pre-production-checklist · CC BY 4.0