skills/mav-bp-application-security/SKILL.md
Application security conventions for all projects. Covers OWASP Top 10 awareness, input validation, secrets management, dependency scanning, SAST/DAST integration, and security headers. Applied when writing or reviewing any code.
npx skillsauth add thermiteau/maverick mav-bp-application-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ensure all code is written with security as a first-class concern. Security is not an afterthought or a bolt-on — it is a design constraint that influences every decision from architecture to individual lines of code.
Before applying these standards, load the project-specific security implementation:
digraph lookup {
"docs/maverick/skills/application-security/SKILL.md exists?" [shape=diamond];
"Read and use alongside these standards" [shape=box];
"Invoke upskill" [shape=box];
"Read generated skill" [shape=box];
"docs/maverick/skills/application-security/SKILL.md exists?" -> "Read and use alongside these standards" [label="yes"];
"docs/maverick/skills/application-security/SKILL.md exists?" -> "Invoke upskill" [label="no"];
"Invoke upskill" -> "Read generated skill";
"Read generated skill" -> "Read and use alongside these standards";
}
docs/maverick/skills/application-security/SKILL.mddo-upskill skill with:
csrf|xss|sanitize|escape|helmet|cors|bcrypt|argon2|hashPassword|validateInput|parameterized|prepared[Ss]tatement|rateLimi|Content-Security-Policy|X-Frame-Options**/security*.*, **/auth*.*, **/middleware*.*, **/sanitize*.*, **/validate*.*, **/.env.exampleEvery developer and reviewer must be familiar with the current OWASP Top 10. When writing or reviewing code, actively consider whether any of these risks apply:
| # | Risk | Key mitigation | | -- | ------------------------------------------- | ------------------------------------------------------------------- | | 1 | Broken Access Control | Enforce authorisation on every endpoint; deny by default | | 2 | Cryptographic Failures | Use strong algorithms (AES-256, RSA-2048+); never roll your own | | 3 | Injection | Parameterised queries; input validation; output encoding | | 4 | Insecure Design | Threat modelling; secure design patterns; abuse case analysis | | 5 | Security Misconfiguration | Harden defaults; remove unused features; automate configuration | | 6 | Vulnerable and Outdated Components | Dependency scanning; regular updates; monitor advisories | | 7 | Identification and Authentication Failures | MFA; strong password policies; session management; rate limiting | | 8 | Software and Data Integrity Failures | Verify signatures; integrity checks on CI/CD; secure deserialization | | 9 | Security Logging and Monitoring Failures | Log security events; detect and alert on suspicious activity | | 10 | Server-Side Request Forgery (SSRF) | Allowlist outbound destinations; validate and sanitise URLs |
Validate all input at the trust boundary before it enters business logic:
Encode all output based on the context where it will be rendered:
| Context | Encoding |
| ---------------- | ----------------------------------------------------- |
| HTML body | HTML entity encoding (< becomes <) |
| HTML attributes | Attribute encoding; always quote attribute values |
| JavaScript | JavaScript hex encoding |
| URL parameters | Percent/URL encoding |
| CSS | CSS hex encoding |
| SQL | Parameterised queries (not encoding — see Injection) |
| JSON | JSON serialisation via standard library |
innerHTML, dangerouslySetInnerHTML, or v-html without sanitisationHttpOnly and Secure flags on cookies — prevent JavaScript access to session tokensOrigin and Referer headers as a defence-in-depth measureSameSite cookie attribute — set to Strict or Lax depending on requirementsexec/system/subprocess with shell=True. If unavoidable, use allowlists and strict escaping.../ sequences; use a safe base directory.env files must be in .gitignoreENV or COPY.env.example as a template — document required variables without values; never include actual secretsPrevent secrets from entering the repository:
Set security headers on all HTTP responses. These are defence-in-depth measures that mitigate entire classes of attacks:
| Header | Recommended Value | Purpose |
| ----------------------------- | ----------------------------------------------- | -------------------------------------------- |
| Content-Security-Policy | Strict policy tailored to the application | Mitigate XSS and data injection |
| Strict-Transport-Security | max-age=63072000; includeSubDomains; preload | Enforce HTTPS |
| X-Content-Type-Options | nosniff | Prevent MIME-type sniffing |
| X-Frame-Options | DENY or SAMEORIGIN | Prevent clickjacking |
| Referrer-Policy | strict-origin-when-cross-origin | Control referrer leakage |
| Permissions-Policy | Restrict unused browser features | Limit API access (camera, microphone, etc.) |
| X-XSS-Protection | 0 (disable — CSP is the modern replacement) | Avoid buggy legacy XSS filter |
| Cache-Control | no-store on sensitive responses | Prevent caching of sensitive data |
default-src 'self' and add specific sources as neededunsafe-inline and unsafe-eval — these negate most of CSP's XSS protection. Use nonces or hashes instead.report-uri or report-to — collect violation reports to detect issues and attacksContent-Security-Policy-Report-Only to test before enforcingIntegrate automated security testing into the CI/CD pipeline:
Always prefer the secure option unless there is a documented, reviewed reason to deviate:
Secure, HttpOnly, SameSite on all session and authentication cookies| Pattern | Issue | Fix |
| -------------------------------------------------------- | ---------------------------- | ------------------------------------------------------------ |
| User input concatenated into SQL query | SQL injection | Use parameterised queries or prepared statements |
| innerHTML, dangerouslySetInnerHTML, or v-html used | XSS vulnerability | Use framework auto-escaping; sanitise with DOMPurify/bleach |
| Hardcoded password, API key, or token in source | Leaked secret | Move to secrets manager; add pre-commit scanning |
| eval(), exec(), or Function() with user input | Code injection | Remove eval; use safe alternatives |
| Password stored as plaintext or with MD5/SHA1 | Weak credential storage | Use bcrypt, scrypt, or Argon2id |
| CSRF protection disabled or missing | Cross-site request forgery | Enable framework CSRF middleware; add anti-CSRF tokens |
| Missing authorisation check on endpoint | Broken access control | Add authorisation middleware; check on every request |
| shell=True or os.system() with user input | Command injection | Use subprocess with argument list; avoid shell execution |
| Sensitive data in log output | Information leakage | Mask or redact before logging |
| .env file committed to repository | Secret exposure | Add to .gitignore; rotate exposed secrets |
| HTTP used instead of HTTPS | Man-in-the-middle risk | Enforce TLS everywhere |
| JWT signature not verified | Authentication bypass | Always verify signature, issuer, audience, and expiry |
| XML parser with external entities enabled | XXE attack | Disable external entity processing; prefer JSON |
| Missing rate limiting on login/auth endpoints | Brute-force vulnerability | Add rate limiting; implement account lockout |
| Wildcard CORS (Access-Control-Allow-Origin: *) | Overly permissive CORS | Restrict to specific allowed origins |
| Debug mode or verbose errors enabled in production | Information disclosure | Disable debug mode; return generic error messages |
| File path constructed from user input without validation | Path traversal | Canonicalise and validate against a safe base directory |
| Deserialisation of untrusted data | Remote code execution | Avoid deserialising untrusted input; use safe formats (JSON) |
| Missing HttpOnly/Secure flags on session cookies | Session hijacking | Set HttpOnly, Secure, and SameSite on all auth cookies |
development
--- name: do-test description: Write or update tests for a code change. Operates in two modes: `unit` (module-scoped, fast, deterministic) and `integration` (crosses module / service / database boundaries). Intended to be invoked once per testable change from inside a do-issue-* or do-epic phase. Mode is required. argument-hint: mode: unit or integration user-invocable: true disable-model-invocation: false --- **Depends on:** mav-bp-unit-testing, mav-bp-integration-testing, mav-local-verificati
development
Implement a focused code change. Use this skill as the wrapper for any implementation work so the Maverick workflow report captures what was done and so the agent applies the project's coding standards before editing. Intended to be invoked once per task from inside a do-issue-* or do-epic phase, not standalone.
testing
How to stack a PR on top of an unmerged sibling branch, and how to retarget it to the repo's default branch once the sibling merges. Prevents orphan-merge incidents when a dependent story is ready before its parent.
development
Claim, lease, heartbeat, and release protocols for when multiple Claude Code instances may act on the same issue or epic concurrently. GitHub labels and marker comments are the coordination surface; local state is a cache.