name: vulnerability-scanner
description: Advanced vulnerability analysis principles covering OWASP 2025, supply chain security, attack surface mapping, and risk prioritization. Use when performing security audits, scanning for vulnerabilities, or reviewing code for security issues.
tags: [security, scanning, owasp, vulnerability]
Vulnerability Scanner
Think like an attacker, defend like an expert. 2025 threat landscape awareness.
Runtime Scripts
Execute for automated validation:
| Script |
Purpose |
Usage |
scripts/security_scan.py |
Validate security principles applied |
python scripts/security_scan.py <project_path> |
Reference Files
| File |
Purpose |
| checklists.md |
OWASP Top 10, Auth, API, Data protection checklists |
1. Security Expert Mindset
Core Principles
| Principle |
Application |
| Assume Breach |
Design as if attacker already inside |
| Zero Trust |
Never trust, always verify |
| Defense in Depth |
Multiple layers, no single point |
| Least Privilege |
Minimum required access only |
| Fail Secure |
On error, deny access |
Threat Modeling Questions
Before scanning, ask:
- What are we protecting? (Assets)
- Who would attack? (Threat actors)
- How would they attack? (Attack vectors)
- What's the impact? (Business risk)
2. OWASP Top 10:2025
Risk Categories
| Rank |
Category |
Think About |
| A01 |
Broken Access Control |
Who can access what? IDOR, SSRF |
| A02 |
Security Misconfiguration |
Defaults, headers, exposed services |
| A03 |
Software Supply Chain (NEW) |
Dependencies, CI/CD, build integrity |
| A04 |
Cryptographic Failures |
Weak crypto, exposed secrets |
| A05 |
Injection |
User input -> system commands |
| A06 |
Insecure Design |
Flawed architecture |
| A07 |
Authentication Failures |
Session, credential management |
| A08 |
Integrity Failures |
Unsigned updates, tampered data |
| A09 |
Logging & Alerting |
Blind spots, no monitoring |
| A10 |
Exceptional Conditions (NEW) |
Error handling, fail-open states |
2025 Key Changes
2021 -> 2025 Shifts:
+-- SSRF merged into A01 (Access Control)
+-- A02 elevated (Cloud/Container configs)
+-- A03 NEW: Supply Chain (major focus)
+-- A10 NEW: Exceptional Conditions
+-- Focus shift: Root causes > Symptoms
3. Supply Chain Security (A03)
Attack Surface
| Vector |
Risk |
Question to Ask |
| Dependencies |
Malicious packages |
Do we audit new deps? |
| Lock files |
Integrity attacks |
Are they committed? |
| Build pipeline |
CI/CD compromise |
Who can modify? |
| Registry |
Typosquatting |
Verified sources? |
Defense Principles
- Verify package integrity (checksums)
- Pin versions, audit updates
- Use private registries for critical deps
- Sign and verify artifacts
4. Attack Surface Mapping
What to Map
| Category |
Elements |
| Entry Points |
APIs, forms, file uploads |
| Data Flows |
Input -> Process -> Output |
| Trust Boundaries |
Where auth/authz checked |
| Assets |
Secrets, PII, business data |
Prioritization Matrix
Risk = Likelihood x Impact
High Impact + High Likelihood -> CRITICAL
High Impact + Low Likelihood -> HIGH
Low Impact + High Likelihood -> MEDIUM
Low Impact + Low Likelihood -> LOW
5. Risk Prioritization
CVSS + Context
| Factor |
Weight |
Question |
| CVSS Score |
Base severity |
How severe is the vuln? |
| EPSS Score |
Exploit likelihood |
Is it being exploited? |
| Asset Value |
Business context |
What's at risk? |
| Exposure |
Attack surface |
Internet-facing? |
Prioritization Decision Tree
Is it actively exploited (EPSS >0.5)?
+-- YES -> CRITICAL: Immediate action
+-- NO -> Check CVSS
+-- CVSS >=9.0 -> HIGH
+-- CVSS 7.0-8.9 -> Consider asset value
+-- CVSS <7.0 -> Schedule for later
6. Exceptional Conditions (A10 - New)
Fail-Open vs Fail-Closed
| Scenario |
Fail-Open (BAD) |
Fail-Closed (GOOD) |
| Auth error |
Allow access |
Deny access |
| Parsing fails |
Accept input |
Reject input |
| Timeout |
Retry forever |
Limit + abort |
What to Check
- Exception handlers that catch-all and ignore
- Missing error handling on security operations
- Race conditions in auth/authz
- Resource exhaustion scenarios
7. Scanning Methodology
Phase-Based Approach
1. RECONNAISSANCE
+-- Understand the target
+-- Technology stack
+-- Entry points
+-- Data flows
2. DISCOVERY
+-- Identify potential issues
+-- Configuration review
+-- Dependency analysis
+-- Code pattern search
3. ANALYSIS
+-- Validate and prioritize
+-- False positive elimination
+-- Risk scoring
+-- Attack chain mapping
4. REPORTING
+-- Actionable findings
+-- Clear reproduction steps
+-- Business impact
+-- Remediation guidance
8. Code Pattern Analysis
High-Risk Patterns
| Pattern |
Risk |
Look For |
| String concat in queries |
Injection |
"SELECT * FROM " + user_input |
| Dynamic code execution |
RCE |
eval(), exec(), Function() |
| Unsafe deserialization |
RCE |
pickle.loads(), unserialize() |
| Path manipulation |
Traversal |
User input in file paths |
| Disabled security |
Various |
verify=False, --insecure |
Secret Patterns
| Type |
Indicators |
| API Keys |
api_key, apikey, high entropy |
| Tokens |
token, bearer, jwt |
| Credentials |
password, secret, key |
| Cloud |
AWS_, AZURE_, GCP_ prefixes |
9. Cloud Security Considerations
Shared Responsibility
| Layer |
You Own |
Provider Owns |
| Data |
Yes |
No |
| Application |
Yes |
No |
| OS/Runtime |
Depends |
Depends |
| Infrastructure |
No |
Yes |
Cloud-Specific Checks
- IAM: Least privilege applied?
- Storage: Public buckets?
- Network: Security groups tightened?
- Secrets: Using secrets manager?
10. Anti-Patterns
| Don't |
Do |
| Scan without understanding |
Map attack surface first |
| Alert on every CVE |
Prioritize by exploitability + asset |
| Ignore false positives |
Maintain verified baseline |
| Fix symptoms only |
Address root causes |
| Scan once before deploy |
Continuous scanning |
| Trust third-party deps blindly |
Verify integrity, audit code |
11. Reporting Principles
Finding Structure
Each finding should answer:
- What? - Clear vulnerability description
- Where? - Exact location (file, line, endpoint)
- Why? - Root cause explanation
- Impact? - Business consequence
- How to fix? - Specific remediation
Severity Classification
| Severity |
Criteria |
| Critical |
RCE, auth bypass, mass data exposure |
| High |
Data exposure, privilege escalation |
| Medium |
Limited scope, requires conditions |
| Low |
Informational, best practice |
Remember: Vulnerability scanning finds issues. Expert thinking prioritizes what matters. Always ask: "What would an attacker do with this?"
1---2name: vulnerability-scanner3description: <!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT -->4---5<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT -->6---7name: vulnerability-scanner8description: Advanced vulnerability analysis principles covering OWASP 2025, supply chain security, attack surface mapping, and risk prioritization. Use when performing security audits, scanning for vulnerabilities, or reviewing code for security issues.9tags: [security, scanning, owasp, vulnerability]10---1112# Vulnerability Scanner1314> Think like an attacker, defend like an expert. 2025 threat landscape awareness.1516## Runtime Scripts1718**Execute for automated validation:**1920| Script | Purpose | Usage |21|--------|---------|-------|22| `scripts/security_scan.py` | Validate security principles applied | `python scripts/security_scan.py <project_path>` |2324## Reference Files2526| File | Purpose |27|------|---------|28| [checklists.md](checklists.md) | OWASP Top 10, Auth, API, Data protection checklists |2930---3132## 1. Security Expert Mindset3334### Core Principles3536| Principle | Application |37|-----------|-------------|38| **Assume Breach** | Design as if attacker already inside |39| **Zero Trust** | Never trust, always verify |40| **Defense in Depth** | Multiple layers, no single point |41| **Least Privilege** | Minimum required access only |42| **Fail Secure** | On error, deny access |4344### Threat Modeling Questions4546Before scanning, ask:471. What are we protecting? (Assets)482. Who would attack? (Threat actors)493. How would they attack? (Attack vectors)504. What's the impact? (Business risk)5152---5354## 2. OWASP Top 10:20255556### Risk Categories5758| Rank | Category | Think About |59|------|----------|-------------|60| **A01** | Broken Access Control | Who can access what? IDOR, SSRF |61| **A02** | Security Misconfiguration | Defaults, headers, exposed services |62| **A03** | Software Supply Chain (NEW) | Dependencies, CI/CD, build integrity |63| **A04** | Cryptographic Failures | Weak crypto, exposed secrets |64| **A05** | Injection | User input -> system commands |65| **A06** | Insecure Design | Flawed architecture |66| **A07** | Authentication Failures | Session, credential management |67| **A08** | Integrity Failures | Unsigned updates, tampered data |68| **A09** | Logging & Alerting | Blind spots, no monitoring |69| **A10** | Exceptional Conditions (NEW) | Error handling, fail-open states |7071### 2025 Key Changes7273```742021 -> 2025 Shifts:75+-- SSRF merged into A01 (Access Control)76+-- A02 elevated (Cloud/Container configs)77+-- A03 NEW: Supply Chain (major focus)78+-- A10 NEW: Exceptional Conditions79+-- Focus shift: Root causes > Symptoms80```8182---8384## 3. Supply Chain Security (A03)8586### Attack Surface8788| Vector | Risk | Question to Ask |89|--------|------|-----------------|90| **Dependencies** | Malicious packages | Do we audit new deps? |91| **Lock files** | Integrity attacks | Are they committed? |92| **Build pipeline** | CI/CD compromise | Who can modify? |93| **Registry** | Typosquatting | Verified sources? |9495### Defense Principles9697- Verify package integrity (checksums)98- Pin versions, audit updates99- Use private registries for critical deps100- Sign and verify artifacts101102---103104## 4. Attack Surface Mapping105106### What to Map107108| Category | Elements |109|----------|----------|110| **Entry Points** | APIs, forms, file uploads |111| **Data Flows** | Input -> Process -> Output |112| **Trust Boundaries** | Where auth/authz checked |113| **Assets** | Secrets, PII, business data |114115### Prioritization Matrix116117```118Risk = Likelihood x Impact119120High Impact + High Likelihood -> CRITICAL121High Impact + Low Likelihood -> HIGH122Low Impact + High Likelihood -> MEDIUM123Low Impact + Low Likelihood -> LOW124```125126---127128## 5. Risk Prioritization129130### CVSS + Context131132| Factor | Weight | Question |133|--------|--------|----------|134| **CVSS Score** | Base severity | How severe is the vuln? |135| **EPSS Score** | Exploit likelihood | Is it being exploited? |136| **Asset Value** | Business context | What's at risk? |137| **Exposure** | Attack surface | Internet-facing? |138139### Prioritization Decision Tree140141```142Is it actively exploited (EPSS >0.5)?143+-- YES -> CRITICAL: Immediate action144+-- NO -> Check CVSS145 +-- CVSS >=9.0 -> HIGH146 +-- CVSS 7.0-8.9 -> Consider asset value147 +-- CVSS <7.0 -> Schedule for later148```149150---151152## 6. Exceptional Conditions (A10 - New)153154### Fail-Open vs Fail-Closed155156| Scenario | Fail-Open (BAD) | Fail-Closed (GOOD) |157|----------|-----------------|---------------------|158| Auth error | Allow access | Deny access |159| Parsing fails | Accept input | Reject input |160| Timeout | Retry forever | Limit + abort |161162### What to Check163164- Exception handlers that catch-all and ignore165- Missing error handling on security operations166- Race conditions in auth/authz167- Resource exhaustion scenarios168169---170171## 7. Scanning Methodology172173### Phase-Based Approach174175```1761. RECONNAISSANCE177 +-- Understand the target178 +-- Technology stack179 +-- Entry points180 +-- Data flows1811822. DISCOVERY183 +-- Identify potential issues184 +-- Configuration review185 +-- Dependency analysis186 +-- Code pattern search1871883. ANALYSIS189 +-- Validate and prioritize190 +-- False positive elimination191 +-- Risk scoring192 +-- Attack chain mapping1931944. REPORTING195 +-- Actionable findings196 +-- Clear reproduction steps197 +-- Business impact198 +-- Remediation guidance199```200201---202203## 8. Code Pattern Analysis204205### High-Risk Patterns206207| Pattern | Risk | Look For |208|---------|------|----------|209| **String concat in queries** | Injection | `"SELECT * FROM " + user_input` |210| **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` |211| **Unsafe deserialization** | RCE | `pickle.loads()`, `unserialize()` |212| **Path manipulation** | Traversal | User input in file paths |213| **Disabled security** | Various | `verify=False`, `--insecure` |214215### Secret Patterns216217| Type | Indicators |218|------|-----------|219| API Keys | `api_key`, `apikey`, high entropy |220| Tokens | `token`, `bearer`, `jwt` |221| Credentials | `password`, `secret`, `key` |222| Cloud | `AWS_`, `AZURE_`, `GCP_` prefixes |223224---225226## 9. Cloud Security Considerations227228### Shared Responsibility229230| Layer | You Own | Provider Owns |231|-------|---------|---------------|232| Data | Yes | No |233| Application | Yes | No |234| OS/Runtime | Depends | Depends |235| Infrastructure | No | Yes |236237### Cloud-Specific Checks238239- IAM: Least privilege applied?240- Storage: Public buckets?241- Network: Security groups tightened?242- Secrets: Using secrets manager?243244---245246## 10. Anti-Patterns247248| Don't | Do |249|-------|-----|250| Scan without understanding | Map attack surface first |251| Alert on every CVE | Prioritize by exploitability + asset |252| Ignore false positives | Maintain verified baseline |253| Fix symptoms only | Address root causes |254| Scan once before deploy | Continuous scanning |255| Trust third-party deps blindly | Verify integrity, audit code |256257---258259## 11. Reporting Principles260261### Finding Structure262263Each finding should answer:2641. **What?** - Clear vulnerability description2652. **Where?** - Exact location (file, line, endpoint)2663. **Why?** - Root cause explanation2674. **Impact?** - Business consequence2685. **How to fix?** - Specific remediation269270### Severity Classification271272| Severity | Criteria |273|----------|----------|274| **Critical** | RCE, auth bypass, mass data exposure |275| **High** | Data exposure, privilege escalation |276| **Medium** | Limited scope, requires conditions |277| **Low** | Informational, best practice |278279---280281> **Remember:** Vulnerability scanning finds issues. Expert thinking prioritizes what matters. Always ask: "What would an attacker do with this?"282283<!-- Source: .faos/custom/skills/security/vulnerability-scanner/SKILL.md -->