security-fundamentals

Auto-invoke when reviewing authentication, authorization, input handling, data exposure, or any user-facing code. Enforces OWASP top 10 awareness and security-first thinking.

25 stars

Best use case

security-fundamentals is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Auto-invoke when reviewing authentication, authorization, input handling, data exposure, or any user-facing code. Enforces OWASP top 10 awareness and security-first thinking.

Teams using security-fundamentals should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/security-fundamentals/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/danielpodolsky/security-fundamentals/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/security-fundamentals/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How security-fundamentals Compares

Feature / Agentsecurity-fundamentalsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Auto-invoke when reviewing authentication, authorization, input handling, data exposure, or any user-facing code. Enforces OWASP top 10 awareness and security-first thinking.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Security Fundamentals Review

> "Security is not a feature. It's a foundation. Build on sand, and the house falls."

## When to Apply

Activate this skill when reviewing:
- Authentication/login flows
- Authorization checks
- User input handling
- Database queries
- File uploads
- API endpoints
- Data exposure in responses

---

## Review Checklist

### Input Validation (NEVER Trust the Client)

- [ ] **All inputs validated**: Is every user input checked before use?
- [ ] **Server-side validation**: Is validation done on the server, not just client?
- [ ] **Type checking**: Are expected types enforced?
- [ ] **Length limits**: Are string lengths bounded?
- [ ] **Whitelist over blacklist**: Are allowed values explicitly defined?

### Authentication

- [ ] **Password hashing**: Are passwords hashed (bcrypt, argon2), not encrypted?
- [ ] **No plaintext secrets**: Are secrets in env vars, not code?
- [ ] **Token expiry**: Do JWTs/sessions have reasonable expiration?
- [ ] **Secure transmission**: Is HTTPS enforced?

### Authorization

- [ ] **Ownership checks**: Can users only access THEIR data?
- [ ] **Role verification**: Are admin routes protected by role checks?
- [ ] **No client-side auth**: Is authorization enforced server-side?

### Data Exposure

- [ ] **Minimal response**: Does the API return only necessary fields?
- [ ] **No sensitive data in URLs**: Are tokens/IDs not in query strings?
- [ ] **No sensitive data in logs**: Are passwords/tokens excluded from logs?

---

## OWASP Top 10 Quick Check

### 1. Injection (SQL, NoSQL, Command)
```
❌ db.query(`SELECT * FROM users WHERE id = ${userId}`);

✅ db.query('SELECT * FROM users WHERE id = ?', [userId]);
```

### 2. Broken Authentication
```
❌ if (req.headers.admin === 'true') { /* allow admin */ }

✅ const user = await verifyToken(req.headers.authorization);
   if (user.role !== 'admin') throw new ForbiddenError();
```

### 3. Sensitive Data Exposure
```
❌ res.json({ user: { ...user, password, ssn } });

✅ res.json({ user: { id: user.id, name: user.name } });
```

### 4. Broken Access Control
```
❌ app.get('/users/:id', async (req, res) => {
     const user = await User.findById(req.params.id);
     res.json(user);
   });

✅ app.get('/users/:id', async (req, res) => {
     const user = await User.findById(req.params.id);
     if (user.id !== req.user.id && req.user.role !== 'admin') {
       throw new ForbiddenError();
     }
     res.json(user);
   });
```

### 5. Security Misconfiguration
```
❌ CORS: origin: '*'
❌ Detailed error messages in production
❌ Debug mode enabled in production

✅ CORS: origin: process.env.ALLOWED_ORIGINS
✅ Generic error messages to clients
✅ Debug mode disabled in production
```

### 6. Cross-Site Scripting (XSS)
```
❌ element.innerHTML = userInput;

✅ element.textContent = userInput;
✅ DOMPurify.sanitize(userInput);
```

---

## Socratic Questions

Ask the junior these questions instead of giving answers:

1. **Trust**: "What stops a malicious user from sending anything they want here?"
2. **Ownership**: "How do you know this user owns this resource?"
3. **Exposure**: "What's the worst thing that could happen if this endpoint is exposed?"
4. **Secrets**: "If I `git clone` this repo, what secrets would I see?"
5. **Injection**: "What if someone sends `'; DROP TABLE users; --` as input?"

---

## Red Flags to Call Out

| Flag | Risk | Question |
|------|------|----------|
| String concatenation in queries | SQL Injection | "Can this input contain SQL?" |
| `eval()` or `new Function()` | Code Injection | "Why is dynamic code execution needed?" |
| `innerHTML` with user data | XSS | "What if the user includes `<script>`?" |
| Passwords in logs | Data Leak | "Who can see these logs?" |
| No rate limiting on auth | Brute Force | "What stops someone from trying every password?" |
| CORS: `*` | Security Bypass | "Should any website be able to call this API?" |
| JWT with no expiry | Token Theft | "What happens if this token is stolen?" |
| IDs in URLs | IDOR | "Can user A access user B's data by changing the ID?" |

---

## Security Checklist Before Deploy

1. [ ] All secrets in environment variables
2. [ ] HTTPS enforced
3. [ ] Input validation on all endpoints
4. [ ] SQL/NoSQL injection prevented (parameterized queries)
5. [ ] XSS prevented (output encoding)
6. [ ] CSRF protection enabled
7. [ ] Rate limiting on auth endpoints
8. [ ] Sensitive data excluded from responses
9. [ ] Authorization checks on every protected route
10. [ ] Security headers set (helmet.js or equivalent)

---

## Never Do This

| Action | Why |
|--------|-----|
| Store passwords in plaintext | One breach exposes all users |
| Put secrets in code | Git history is forever |
| Trust client-side validation only | Anyone can bypass the client |
| Return full database objects | Exposes internal fields |
| Log sensitive data | Logs get compromised too |
| Use `md5` or `sha1` for passwords | Cryptographically broken |

Related Skills

checking-session-security

25
from ComeOnOliver/skillshub

This skill enables Claude to check session security implementations within a codebase. It analyzes session management practices to identify potential vulnerabilities. Use this skill when a user requests to "check session security", "audit session handling", "review session implementation", or asks about "session security best practices" in their code. It helps identify issues like insecure session IDs, lack of proper session expiration, or insufficient protection against session fixation attacks. This skill leverages the session-security-checker plugin. Activates when you request "checking session security" functionality.

performing-security-testing

25
from ComeOnOliver/skillshub

This skill automates security vulnerability testing. It is triggered when the user requests security assessments, penetration tests, or vulnerability scans. The skill covers OWASP Top 10 vulnerabilities, SQL injection, XSS, CSRF, authentication issues, and authorization flaws. Use this skill when the user mentions "security test", "vulnerability scan", "OWASP", "SQL injection", "XSS", "CSRF", "authentication", or "authorization" in the context of application or API testing.

performing-security-audits

25
from ComeOnOliver/skillshub

This skill allows Claude to conduct comprehensive security audits of code, infrastructure, and configurations. It leverages various tools within the security-pro-pack plugin, including vulnerability scanning, compliance checking, cryptography review, and infrastructure security analysis. Use this skill when a user requests a "security audit," "vulnerability assessment," "compliance review," or any task involving identifying and mitigating security risks. It helps to ensure code and systems adhere to security best practices and compliance standards.

security-policy-generator

25
from ComeOnOliver/skillshub

Security Policy Generator - Auto-activating skill for Security Advanced. Triggers on: security policy generator, security policy generator Part of the Security Advanced skill category.

finding-security-misconfigurations

25
from ComeOnOliver/skillshub

This skill enables Claude to identify potential security misconfigurations in various systems and configurations. It leverages the security-misconfiguration-finder plugin to analyze infrastructure-as-code, application configurations, and system settings, pinpointing common vulnerabilities and compliance issues. Use this skill when the user asks to "find security misconfigurations", "check for security vulnerabilities in my configuration", "audit security settings", or requests a security assessment of a specific system or file. This skill will assist in identifying and remediating potential security weaknesses.

responding-to-security-incidents

25
from ComeOnOliver/skillshub

Assists with security incident response, investigation, and remediation. This skill is triggered when the user requests help with incident response, mentions specific incident types (e.g., data breach, ransomware, DDoS), or uses terms like "incident response plan", "containment", "eradication", or "post-incident activity". It guides the user through the incident response lifecycle, from preparation to post-incident analysis. It is useful for classifying incidents, creating response playbooks, collecting evidence, constructing timelines, and generating remediation steps. Use this skill when needing to respond to a "security incident".

security-headers-generator

25
from ComeOnOliver/skillshub

Security Headers Generator - Auto-activating skill for Security Fundamentals. Triggers on: security headers generator, security headers generator Part of the Security Fundamentals skill category.

analyzing-security-headers

25
from ComeOnOliver/skillshub

This skill analyzes HTTP security headers of a given domain to identify potential vulnerabilities and misconfigurations. It provides a detailed report with a grade, score, and recommendations for improvement. Use this skill when the user asks to "analyze security headers", "check HTTP security", "scan for security vulnerabilities", or requests a "security audit" of a website. It will automatically activate when security-related keywords are used in conjunction with domain names or URLs.

security-group-generator

25
from ComeOnOliver/skillshub

Security Group Generator - Auto-activating skill for AWS Skills. Triggers on: security group generator, security group generator Part of the AWS Skills skill category.

security-benchmark-runner

25
from ComeOnOliver/skillshub

Security Benchmark Runner - Auto-activating skill for Security Advanced. Triggers on: security benchmark runner, security benchmark runner Part of the Security Advanced skill category.

scanning-database-security

25
from ComeOnOliver/skillshub

Process use when you need to work with security and compliance. This skill provides security scanning and vulnerability detection with comprehensive guidance and automation. Trigger with phrases like "scan for vulnerabilities", "implement security controls", or "audit security".

scanning-container-security

25
from ComeOnOliver/skillshub

Execute use when you need to work with security and compliance. This skill provides security scanning and vulnerability detection with comprehensive guidance and automation. Trigger with phrases like "scan for vulnerabilities", "implement security controls", or "audit security".