Skip to content
Skills Library
Security · Review & audit

frontend-security

/frontend-security

Protect SaaS frontends against XSS, CSRF, clickjacking, open redirects, token leakage and unsafe client-side data handling in React, Next.js, Vue, Nuxt, Angular and server-rendered templates (Blade, Django templates). Use when reviewing UI code, templates, CSP or browser-facing configuration.

Licence
MIT
Last repository change
07.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Protect SaaS frontends against XSS, CSRF, clickjacking, open redirects, token leakage and unsafe client-side data handling in React, Next.js, Vue, Nuxt, Angular and server-rendered templates (Blade, Django templates). Use when reviewing UI code, templates, CSP or browser-facing configuration.

Original author description

Protect SaaS frontends against XSS, CSRF, clickjacking, open redirects, token leakage and unsafe client-side data handling in React, Next.js, Vue, Nuxt, Angular and server-rendered templates (Blade, Django templates). Use when reviewing UI code, templates, CSP or browser-facing configuration.

How it works

  1. Objectives
  2. Steps
  3. Security rules
  4. Validation criteria
Original SKILL.md headings · 46 lines, 346 words
SKILL.md preview
---
name: frontend-security
description: Protect SaaS frontends against XSS, CSRF, clickjacking, open redirects, token leakage and unsafe client-side data handling in React, Next.js, Vue, Nuxt, Angular and server-rendered templates (Blade, Django templates). Use when reviewing UI code, templates, CSP or browser-facing configuration.
---

# Frontend security

Part of saas-blind-security — created and maintained by IbrahimCodeur.

## Objectives

- User-controlled data can never execute as code in the browser.
- State-changing requests cannot be forged cross-site; pages cannot be framed maliciously.
- The client never holds secrets or makes security decisions.

## Steps

1. **XSS sinks.** Review: React `dangerouslySetInnerHTML`, `innerHTML`/`outerHTML`/`insertAdjacentHTML`,
   `document.write`, Vue `v-html`, Angular `bypassSecurityTrust*`, Blade `{!! !!}`, Django `|safe`/`mark_safe`,
   Jinja `Markup`, `href`/`src` bound to user data (`javascript:` URLs), Markdown renderers, rich-text editors.
   Semgrep: `sbs-js-dangerous-html-sink`, `sbs-vue-v-html`, `sbs-blade-unescaped-output`,
   `sbs-angular-bypass-security-trust`, `sbs-py-django-mark-safe-variable`. Fix: render as text, or sanitise
   with DOMPurify (client) / HTML Purifier / bleach-like allow-list (server); validate URL schemes.
2. **CSP.** Add a Content-Security-Policy (nonce- or hash-based scripts, `object-src 'none'`,
   `base-uri 'self'`, `frame-ancestors`), start in `Report-Only` if needed. Avoid `'unsafe-inline'`/`'unsafe-eval'`.
3. **CSRF.** Cookie-authenticated state changes need CSRF protection: Laravel `VerifyCsrfToken` (check the
   `$except` list), Django `CsrfViewMiddleware` (review `@csrf_exempt`), SameSite cookies, Next.js server
   actions origin checks, double-submit tokens for SPAs. Token-in-header APIs are not exposed to CSRF if they do
   not accept cookies.
4. **Clickjacking.** `X-Frame-Options: DENY` or CSP `frame-ancestors 'none'` (allow-list for embeds).
5. **Token storage.** Prefer HttpOnly cookies over `localStorage` for session tokens; never put secrets in
   `NEXT_PUBLIC_*`/`VITE_*`/`NUXT_PUBLIC_*` or the bundle; source maps not public in production.
6. **Open redirects.** `?next=`/`returnUrl` validated against relative paths or an allow-list.
7. **postMessage / third parties.** Check `event.origin`; Subresource Integrity for CDN scripts; review
   third-party scripts' access to pages with sensitive data.
8. **Client-side checks are UX only.** Every permission, price, quota and validation is repeated server-side.
9. **Headers.** Run `$SBS/scripts/check-headers.sh http://localhost:<port>` against a local build.

## Security rules

- Do not disable framework auto-escaping or CSRF middleware to fix a bug.
- Never test XSS payloads on production or on other people's systems.

## Validation criteria

- [ ] All raw-HTML sinks removed or fed only by sanitised/constant data (tests with `<img src=x onerror=alert(1)>`).
- [ ] CSRF protection active on cookie-authenticated mutations (test without token → 419/403).
- [ ] CSP and anti-framing headers present (header check output attached).
- [ ] No secret in client bundles or public env vars.

Versions

RepositoryScoreLicence
This page · IbrahimCodeur/saas-blind-security90MIT
schalkneethling/create-project-calavera100MIT
reddygopalkrishna/developer-agent-skills100MIT
susorov/agent-skills90MIT
j4flmao/agent-skills90MIT

Database snapshot: 13.11.2026 · package version 44d2ca4ca46b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100client-side-security
    Apply when reviewing or writing browser-facing code that handles user input, renders HTML, sets cookies, or loads third-party scripts. Covers XSS, CSRF, CSP, clickjacking, XS-Leaks, and HTTP security headers.
  • 100angular-security
    Angular frontend security: XSS and DomSanitizer, CSRF/XSRF, CSP and Trusted Types, auth and session handling, route guards, HttpClient and SSR hardening, NgRx and supply-chain risks, deployment hardening (OWASP 2025). Use when writing or reviewing security-sensitive Angular…
  • 100fec-security-review
    Use when reviewing frontend security risks such as XSS, CSRF, sensitive data exposure, unsafe DOM APIs, untrusted user input, authentication/token handling, payment flows, file upload, CSP, dependency risk, or third-party scripts; Chinese triggers include security review, security check.
  • 100frontend-security-audit
    Reference and review procedure for frontend security - XSS and unsafe HTML, CSRF, CORS, Content Security Policy, JWT and session token handling, secure cookies (HttpOnly, Secure, SameSite), token lifecycle, authentication vs authorization, role- and permission-based access…
  • 100web-input-security
    Secure the browser-facing surface: XSS, CSRF, file uploads, security headers, cookie flags, sensitive browser storage and open redirects. Use when building or auditing pages, forms, uploads, cookies or redirect logic.
  • 90angular-security
    Harden Angular apps against XSS, CSP violations, and unauthorized access. Use when implementing XSS protection, Content Security Policy, or auth guards in Angular.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.