kin9zeus/senior-engineer-skills/security-hardening
Claude Code and agent skill by kin9zeus/senior-engineer-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Application security engineering — OWASP Top 10, authentication and object-level authorization, injection, XSS/CSP, CSRF, SSRF, secrets management, file uploads, security headers, dependency and supply-chain risk, and threat modelling. Use when reviewing or building anything touching login, sessions, tokens, passwords, permissions, roles, payments, file uploads, webhooks, user-generated content or personal data; when the user says "is this secure", "security review", "pentest", "harden", "vulnerability", "OWASP", "XSS", "SQL injection", "CSRF", "IDOR", "leaked key", "exposed secret", "auth bypass", "rate limit" or "security headers"; and as a mandatory pass in any project audit. Defensive security only. By Devleck.
Install
npx vskill@latest install kin9zeus/senior-engineer-skills/security-hardeningSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as kin9zeus/senior-engineer-skills/security-hardening.
Security Hardening
Assume every input is hostile, every user is an attacker, and every secret in the repository is already public. Then check whether the code agrees.
Scope: defensive security — finding and fixing weaknesses in code the user owns or is authorised to assess. Never scan, probe or send traffic to infrastructure without explicit confirmation of ownership or authorisation. Produce fixes and detections, not weaponised exploits.
The order of operations
Findings are not equal. Work top-down; the first three account for most real breaches.
- Secrets — anything committed is compromised.
- Broken access control — the most common critical finding in real systems.
- Injection — SQL, command, template, LDAP, NoSQL.
- Authentication weaknesses — sessions, tokens, resets, MFA.
- XSS and content injection.
- SSRF and unvalidated redirects.
- Insecure configuration — headers, debug modes, exposed endpoints.
- Supply chain — dependencies, install scripts, build pipeline.
- Cryptographic failures — at rest, in transit, in tokens.
- Logging and monitoring gaps — an undetected breach is an unbounded one.
references/owasp-checklist.md carries the full per-category checks.
1. Secrets — start here, always
Plus the pattern scan in scripts/secret-scan.sh / .ps1.
Anything found in history is disclosed, even if a later commit removed it. It lives in every clone, every fork, every CI cache. The remediation order is fixed:
- Rotate the credential. Immediately, before anything else.
- Check for abuse — provider audit logs, unexpected usage, unfamiliar IPs.
- Purge the history (
git filter-repo, or BFG) and force-push, with every
collaborator re-cloning.
- Prevent recurrence — secret scanning in CI, pre-commit hooks,
.gitignore.
Doing step 3 without step 1 is the most common mistake: it makes the repository look clean while the key stays live.
Also check for secrets in: built client bundles, source maps, container image layers, CI logs, error messages, and PUBLIC_-prefixed environment variables.
Then ask what a stolen secret is worth. A credential that is narrow, restricted to your network, capped in spend and distinct per environment turns a leak into an annoyance. A single all-powerful key turns it into a breach. If a hosting provider announces that stored variables may be exposed, the response is rotation, not reassurance — see security-incident-response.
2. Broken access control — the highest-yield review
This is where the severe findings are. Authentication answers who are you; authorization answers may you do this to this object. Systems get the first right and the second wrong.
The test that finds it: authenticate as user A, then request user B's resource by changing an identifier.
Grep for the shape of the bug — a lookup by id with no ownership predicate:
Then read each hit and ask: where is the caller's relationship to this object asserted? If the answer is "the frontend only shows the user their own", it is an IDOR and it is a P0.
Also check:
- Function-level access control. Admin endpoints reachable by non-admins.
"Unlinked" is not access control.
- Mass assignment. A request body that can set
role,is_admin,
organization_id, price or verified because the handler spreads it into the model.
- Privilege escalation paths. Can a member invite themselves as owner? Can a
user change their own role? Can an org admin reach another org?
- Deny by default. Is there a route with no policy declared? What does the
system do — allow or deny?
See references/authz-patterns.md.
3. Injection
| Type | The bug | The fix | |
|---|---|---|---|
| SQL | String concatenation or interpolation into a query | Parameterised queries. Always. Identifiers that must be dynamic come from an allowlist, never from input | |
| Command | User input reaching a shell | Avoid shells; use argument-array APIs; allowlist | |
| Template | User input rendered as a template | Never render user strings as templates | |
| NoSQL | Objects passed where scalars are expected ({$ne: null}) | Coerce and validate types at the boundary | |
| Path | User-controlled path segments | Resolve, then verify the result stays inside the intended root | |
| Header / log | Newlines in user input reaching headers or logs | Strip control characters |
An ORM does not make you safe. .raw(), .extra(), whereRaw, FromSqlRaw and text() all bypass parameterisation.
4. Authentication
- Password hashing: argon2id, scrypt, or bcrypt at a current cost. Never MD5,
SHA-1, SHA-256, or an unsalted hash.
- Session invalidation on logout, on password change, and on privilege change.
- Tokens: short-lived access tokens, rotating refresh tokens with reuse
detection. JWTs verified with a pinned algorithm — reject alg: none and never let the token choose its own verification algorithm.
- Password reset: single-use, time-bounded, invalidated on use, and delivered
without leaking whether the account exists.
- No user enumeration: identical response and timing for existing and
non-existing accounts on login, reset and registration.
- Rate limiting and progressive delay on login, reset and registration.
- MFA available, and enforced for privileged accounts.
- Cookies:
HttpOnly,Secure,SameSite=LaxorStrict, scoped path.
See references/auth-patterns.md.
5. XSS, CSP and content
- Output encoded by default; every escape hatch (
dangerouslySetInnerHTML,
v-html, innerHTML, |safe, html_safe, raw) individually justified and fed only sanitised content.
- Sanitise with a maintained library on an allowlist basis, server-side, at
render.
- A CSP without `unsafe-inline` and without `unsafe-eval`, using nonces or
hashes. This is the control that turns most XSS from critical into noise.
- User-supplied URLs validated against a scheme allowlist —
javascript:and
data: in an href are XSS.
- File uploads served from a separate origin, with
Content-Disposition: attachment and X-Content-Type-Options: nosniff.
6. The rest of the surface
SSRF — any server-side fetch of a user-supplied URL is a finding until it has a scheme and host allowlist, blocks private and link-local ranges, blocks redirects to them, and resolves DNS before connecting (to defeat rebinding). Cloud metadata endpoints are the usual target.
CSRF — SameSite cookies plus tokens for cookie-authenticated state changes. Token-in-header auth is not automatically immune if a cookie fallback exists.
CORS — an explicit origin allowlist. Reflecting the request origin with Allow-Credentials: true is equivalent to no policy at all.
Uploads — verify content, not extension; cap size; never store with a user-controlled filename; never serve from a path that can execute; scan where the threat model warrants it.
Redirects — never redirect to a user-supplied URL without an allowlist.
Headers — HSTS, X-Content-Type-Options: nosniff, Referrer-Policy, frame-ancestors, Permissions-Policy. Remove X-Powered-By and version banners.
Configuration — debug off, stack traces not returned to clients, directory listing off, default credentials changed, admin interfaces network-restricted, cloud storage buckets not public.
See references/security-headers.md.
7. Supply chain
- Lockfile committed; builds install from it with a frozen/
ciflag. - Automated vulnerability alerts enabled and actually triaged.
- Run the ecosystem's audit tool and read the real output — never assert a
CVE from memory.
- Review
postinstallandpreinstallscripts in the dependency tree; they run
arbitrary code on every developer machine and CI runner.
- Pin CI actions to a commit SHA, not a moving tag.
- CI secrets scoped to the minimum, never exposed to workflows triggered by
forks.
- Generate an SBOM for anything distributed.
- Licence policy enforced in CI.
See references/supply-chain.md.
8. Assume the platform and the runtime can fail
Application code is one layer. Two recent classes of event sit below it, and code review will not find them:
- A platform breach — a host, CI or secrets store exposing the variables it
stores. Defence is not a code fix: it is making every credential narrow, network-restricted, spend-capped and rotatable. Load cloud-security. If it has already happened, load security-incident-response — rotate upstream first and prove the old value dead.
- A flaw in the language runtime or web server — for example the critical,
actively targeted PHP remote-code-execution pair disclosed in October 2026. Defence is inventory, patch, restart and verify the running build. Load php-hardening for PHP; the same discipline applies to any runtime.
Check in every review: which exact runtime build is serving traffic, is it supported and patched, and what could a code-execution flaw in it read? (Everything in the process's environment and filesystem — which is why §1 and cloud-security matter.)
Also route by situation:
| Situation | Skill | |
|---|---|---|
| The user wants the system attacked (tested), not reviewed | pentest-methodology — needs written authorisation and a scope file first | |
| An AI feature, agent, tool or MCP server | ai-security | |
| Something may already be compromised | security-incident-response |
9. Threat modelling — for new systems and major features
Four questions, thirty minutes, in references/threat-modelling.md:
- What are we building? (a data-flow sketch with trust boundaries)
- What can go wrong? (STRIDE per boundary)
- What are we doing about it? (a control per threat)
- Did we do a good job? (a test per control)
Reporting a security finding
Always include the failing test. A security fix without a regression test will be reintroduced.
References and scripts
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security-hardening/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kin9zeus/senior-engineer-skills/security-hardening)