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 🆕 |
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 🆕 |
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 × 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 |
✅ |
❌ |
| Application |
✅ |
❌ |
| OS/Runtime |
Depends |
Depends |
| Infrastructure |
❌ |
✅ |
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?"
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
1---2name: vulnerability-scanner3description: "Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization."4allowed-tools: Read, Glob, Grep, Bash5risk: unknown6source: community7metadata:8 source: https://skillmd.com/skills/mayurrathi/vulnerability-scanner9---1011# Vulnerability Scanner1213> Think like an attacker, defend like an expert. 2025 threat landscape awareness.1415## 🔧 Runtime Scripts1617**Execute for automated validation:**1819| Script | Purpose | Usage |20|--------|---------|-------|21| `scripts/security_scan.py` | Validate security principles applied | `python scripts/security_scan.py <project_path>` |2223## 📋 Reference Files2425| File | Purpose |26|------|---------|27| [checklists.md](checklists.md) | OWASP Top 10, Auth, API, Data protection checklists |2829---3031## 1. Security Expert Mindset3233### Core Principles3435| Principle | Application |36|-----------|-------------|37| **Assume Breach** | Design as if attacker already inside |38| **Zero Trust** | Never trust, always verify |39| **Defense in Depth** | Multiple layers, no single point |40| **Least Privilege** | Minimum required access only |41| **Fail Secure** | On error, deny access |4243### Threat Modeling Questions4445Before scanning, ask:461. What are we protecting? (Assets)472. Who would attack? (Threat actors)483. How would they attack? (Attack vectors)494. What's the impact? (Business risk)5051---5253## 2. OWASP Top 10:20255455### Risk Categories5657| Rank | Category | Think About |58|------|----------|-------------|59| **A01** | Broken Access Control | Who can access what? IDOR, SSRF |60| **A02** | Security Misconfiguration | Defaults, headers, exposed services |61| **A03** | Software Supply Chain 🆕 | Dependencies, CI/CD, build integrity |62| **A04** | Cryptographic Failures | Weak crypto, exposed secrets |63| **A05** | Injection | User input → system commands |64| **A06** | Insecure Design | Flawed architecture |65| **A07** | Authentication Failures | Session, credential management |66| **A08** | Integrity Failures | Unsigned updates, tampered data |67| **A09** | Logging & Alerting | Blind spots, no monitoring |68| **A10** | Exceptional Conditions 🆕 | Error handling, fail-open states |6970### 2025 Key Changes7172```732021 → 2025 Shifts:74├── SSRF merged into A01 (Access Control)75├── A02 elevated (Cloud/Container configs)76├── A03 NEW: Supply Chain (major focus)77├── A10 NEW: Exceptional Conditions78└── Focus shift: Root causes > Symptoms79```8081---8283## 3. Supply Chain Security (A03)8485### Attack Surface8687| Vector | Risk | Question to Ask |88|--------|------|-----------------|89| **Dependencies** | Malicious packages | Do we audit new deps? |90| **Lock files** | Integrity attacks | Are they committed? |91| **Build pipeline** | CI/CD compromise | Who can modify? |92| **Registry** | Typosquatting | Verified sources? |9394### Defense Principles9596- Verify package integrity (checksums)97- Pin versions, audit updates98- Use private registries for critical deps99- Sign and verify artifacts100101---102103## 4. Attack Surface Mapping104105### What to Map106107| Category | Elements |108|----------|----------|109| **Entry Points** | APIs, forms, file uploads |110| **Data Flows** | Input → Process → Output |111| **Trust Boundaries** | Where auth/authz checked |112| **Assets** | Secrets, PII, business data |113114### Prioritization Matrix115116```117Risk = Likelihood × Impact118119High Impact + High Likelihood → CRITICAL120High Impact + Low Likelihood → HIGH121Low Impact + High Likelihood → MEDIUM122Low Impact + Low Likelihood → LOW123```124125---126127## 5. Risk Prioritization128129### CVSS + Context130131| Factor | Weight | Question |132|--------|--------|----------|133| **CVSS Score** | Base severity | How severe is the vuln? |134| **EPSS Score** | Exploit likelihood | Is it being exploited? |135| **Asset Value** | Business context | What's at risk? |136| **Exposure** | Attack surface | Internet-facing? |137138### Prioritization Decision Tree139140```141Is it actively exploited (EPSS >0.5)?142├── YES → CRITICAL: Immediate action143└── NO → Check CVSS144 ├── CVSS ≥9.0 → HIGH145 ├── CVSS 7.0-8.9 → Consider asset value146 └── CVSS <7.0 → Schedule for later147```148149---150151## 6. Exceptional Conditions (A10 - New)152153### Fail-Open vs Fail-Closed154155| Scenario | Fail-Open (BAD) | Fail-Closed (GOOD) |156|----------|-----------------|---------------------|157| Auth error | Allow access | Deny access |158| Parsing fails | Accept input | Reject input |159| Timeout | Retry forever | Limit + abort |160161### What to Check162163- Exception handlers that catch-all and ignore164- Missing error handling on security operations165- Race conditions in auth/authz166- Resource exhaustion scenarios167168---169170## 7. Scanning Methodology171172### Phase-Based Approach173174```1751. RECONNAISSANCE176 └── Understand the target177 ├── Technology stack178 ├── Entry points179 └── Data flows1801812. DISCOVERY182 └── Identify potential issues183 ├── Configuration review184 ├── Dependency analysis185 └── Code pattern search1861873. ANALYSIS188 └── Validate and prioritize189 ├── False positive elimination190 ├── Risk scoring191 └── Attack chain mapping1921934. REPORTING194 └── Actionable findings195 ├── Clear reproduction steps196 ├── Business impact197 └── Remediation guidance198```199200---201202## 8. Code Pattern Analysis203204### High-Risk Patterns205206| Pattern | Risk | Look For |207|---------|------|----------|208| **String concat in queries** | Injection | `"SELECT * FROM " + user_input` |209| **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` |210| **Unsafe deserialization** | RCE | `pickle.loads()`, `unserialize()` |211| **Path manipulation** | Traversal | User input in file paths |212| **Disabled security** | Various | `verify=False`, `--insecure` |213214### Secret Patterns215216| Type | Indicators |217|------|-----------|218| API Keys | `api_key`, `apikey`, high entropy |219| Tokens | `token`, `bearer`, `jwt` |220| Credentials | `password`, `secret`, `key` |221| Cloud | `AWS_`, `AZURE_`, `GCP_` prefixes |222223---224225## 9. Cloud Security Considerations226227### Shared Responsibility228229| Layer | You Own | Provider Owns |230|-------|---------|---------------|231| Data | ✅ | ❌ |232| Application | ✅ | ❌ |233| OS/Runtime | Depends | Depends |234| Infrastructure | ❌ | ✅ |235236### Cloud-Specific Checks237238- IAM: Least privilege applied?239- Storage: Public buckets?240- Network: Security groups tightened?241- Secrets: Using secrets manager?242243---244245## 10. Anti-Patterns246247| ❌ Don't | ✅ Do |248|----------|-------|249| Scan without understanding | Map attack surface first |250| Alert on every CVE | Prioritize by exploitability + asset |251| Ignore false positives | Maintain verified baseline |252| Fix symptoms only | Address root causes |253| Scan once before deploy | Continuous scanning |254| Trust third-party deps blindly | Verify integrity, audit code |255256---257258## 11. Reporting Principles259260### Finding Structure261262Each finding should answer:2631. **What?** - Clear vulnerability description2642. **Where?** - Exact location (file, line, endpoint)2653. **Why?** - Root cause explanation2664. **Impact?** - Business consequence2675. **How to fix?** - Specific remediation268269### Severity Classification270271| Severity | Criteria |272|----------|----------|273| **Critical** | RCE, auth bypass, mass data exposure |274| **High** | Data exposure, privilege escalation |275| **Medium** | Limited scope, requires conditions |276| **Low** | Informational, best practice |277278---279280> **Remember:** Vulnerability scanning finds issues. Expert thinking prioritizes what matters. Always ask: "What would an attacker do with this?"281282## When to Use283This skill is applicable to execute the workflow or actions described in the overview.