Agent skill
security
Security audit, vulnerability scanning, and secure coding practices. Use when reviewing code for OWASP vulnerabilities, implementing auth, securing APIs, or handling sensitive data.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/security-dgkngk-super-kit
SKILL.md
Security Skill
Overview
Security audit, vulnerability scanning, and secure coding practices.
OWASP Top 10 Checks
1. Injection (SQL, NoSQL, Command)
// ❌ Vulnerable
const query = `SELECT * FROM users WHERE id = ${userId}`;
// ✅ Safe - Parameterized query
const query = 'SELECT * FROM users WHERE id = $1';
await db.query(query, [userId]);
2. Authentication Flaws
// Password hashing
import bcrypt from 'bcrypt';
async function hashPassword(password: string) {
return bcrypt.hash(password, 12);
}
async function verifyPassword(password: string, hash: string) {
return bcrypt.compare(password, hash);
}
3. XSS Prevention
// ❌ Dangerous
element.innerHTML = userInput;
// ✅ Safe - Escape output
element.textContent = userInput;
// React auto-escapes, but avoid dangerouslySetInnerHTML
4. CSRF Protection
// Use CSRF tokens
import csrf from 'csurf';
const csrfProtection = csrf({ cookie: true });
app.use(csrfProtection);
// In form
<input type="hidden" name="_csrf" value={csrfToken} />
5. Security Headers
// helmet middleware
import helmet from 'helmet';
app.use(helmet({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-inline'"],
styleSrc: ["'self'", "'unsafe-inline'"],
},
},
}));
JWT Security
import jwt from 'jsonwebtoken';
// ✅ Best practices
const token = jwt.sign(
{ userId: user.id },
process.env.JWT_SECRET,
{
algorithm: 'HS256',
expiresIn: '15m', // Short expiry
issuer: 'my-app',
audience: 'my-app-users',
}
);
// Verify with options
jwt.verify(token, process.env.JWT_SECRET, {
algorithms: ['HS256'], // Prevent algorithm switching
issuer: 'my-app',
});
Secrets Management
# Never commit secrets
.env
.env.local
*.pem
*.key
Security Audit Commands
# NPM audit
npm audit --audit-level=high
# Check for leaked secrets
npx secretlint "**/*"
# Dependency vulnerabilities
npx snyk test
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?