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
Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization.
Covers: 🔧 Runtime Scripts, 📋 Reference Files, Security Expert Mindset, Core Principles, Threat Modeling Questions.
1---2name: vulnerability-scanner3description: Advanced vulnerability analysis principles. OWASP 2025, Supply Chain4 Security, attack surface mapping, risk prioritization.5allowed-tools: Read, Glob, Grep, Bash6risk: safe7source: community8license: MIT9metadata:10 source: https://skillmd.com/skills/jantoniofc/vulnerability-scanner11---1213# Vulnerability Scanner1415> Think like an attacker, defend like an expert. 2025 threat landscape awareness.1617## 🔧 Runtime Scripts1819**Execute for automated validation:**2021| Script | Purpose | Usage |22|--------|---------|-------|23| `scripts/security_scan.py` | Validate security principles applied | `python scripts/security_scan.py <project_path>` |2425## 📋 Reference Files2627| File | Purpose |28|------|---------|29| [checklists.md](checklists.md) | OWASP Top 10, Auth, API, Data protection checklists |3031---3233## 1. Security Expert Mindset3435### Core Principles3637| Principle | Application |38|-----------|-------------|39| **Assume Breach** | Design as if attacker already inside |40| **Zero Trust** | Never trust, always verify |41| **Defense in Depth** | Multiple layers, no single point |42| **Least Privilege** | Minimum required access only |43| **Fail Secure** | On error, deny access |4445### Threat Modeling Questions4647Before scanning, ask:481. What are we protecting? (Assets)492. Who would attack? (Threat actors)503. How would they attack? (Attack vectors)514. What's the impact? (Business risk)5253---5455## 2. OWASP Top 10:20255657### Risk Categories5859| Rank | Category | Think About |60|------|----------|-------------|61| **A01** | Broken Access Control | Who can access what? IDOR, SSRF |62| **A02** | Security Misconfiguration | Defaults, headers, exposed services |63| **A03** | Software Supply Chain 🆕 | Dependencies, CI/CD, build integrity |64| **A04** | Cryptographic Failures | Weak crypto, exposed secrets |65| **A05** | Injection | User input → system commands |66| **A06** | Insecure Design | Flawed architecture |67| **A07** | Authentication Failures | Session, credential management |68| **A08** | Integrity Failures | Unsigned updates, tampered data |69| **A09** | Logging & Alerting | Blind spots, no monitoring |70| **A10** | Exceptional Conditions 🆕 | Error handling, fail-open states |7172### 2025 Key Changes7374```752021 → 2025 Shifts:76├── SSRF merged into A01 (Access Control)77├── A02 elevated (Cloud/Container configs)78├── A03 NEW: Supply Chain (major focus)79├── A10 NEW: Exceptional Conditions80└── Focus shift: Root causes > Symptoms81```8283---8485## 3. Supply Chain Security (A03)8687### Attack Surface8889| Vector | Risk | Question to Ask |90|--------|------|-----------------|91| **Dependencies** | Malicious packages | Do we audit new deps? |92| **Lock files** | Integrity attacks | Are they committed? |93| **Build pipeline** | CI/CD compromise | Who can modify? |94| **Registry** | Typosquatting | Verified sources? |9596### Defense Principles9798- Verify package integrity (checksums)99- Pin versions, audit updates100- Use private registries for critical deps101- Sign and verify artifacts102103---104105## 4. Attack Surface Mapping106107### What to Map108109| Category | Elements |110|----------|----------|111| **Entry Points** | APIs, forms, file uploads |112| **Data Flows** | Input → Process → Output |113| **Trust Boundaries** | Where auth/authz checked |114| **Assets** | Secrets, PII, business data |115116### Prioritization Matrix117118```119Risk = Likelihood × Impact120121High Impact + High Likelihood → CRITICAL122High Impact + Low Likelihood → HIGH123Low Impact + High Likelihood → MEDIUM124Low Impact + Low Likelihood → LOW125```126127---128129## 5. Risk Prioritization130131### CVSS + Context132133| Factor | Weight | Question |134|--------|--------|----------|135| **CVSS Score** | Base severity | How severe is the vuln? |136| **EPSS Score** | Exploit likelihood | Is it being exploited? |137| **Asset Value** | Business context | What's at risk? |138| **Exposure** | Attack surface | Internet-facing? |139140### Prioritization Decision Tree141142```143Is it actively exploited (EPSS >0.5)?144├── YES → CRITICAL: Immediate action145└── NO → Check CVSS146 ├── CVSS ≥9.0 → HIGH147 ├── CVSS 7.0-8.9 → Consider asset value148 └── CVSS <7.0 → Schedule for later149```150151---152153## 6. Exceptional Conditions (A10 - New)154155### Fail-Open vs Fail-Closed156157| Scenario | Fail-Open (BAD) | Fail-Closed (GOOD) |158|----------|-----------------|---------------------|159| Auth error | Allow access | Deny access |160| Parsing fails | Accept input | Reject input |161| Timeout | Retry forever | Limit + abort |162163### What to Check164165- Exception handlers that catch-all and ignore166- Missing error handling on security operations167- Race conditions in auth/authz168- Resource exhaustion scenarios169170---171172## 7. Scanning Methodology173174### Phase-Based Approach175176```1771. RECONNAISSANCE178 └── Understand the target179 ├── Technology stack180 ├── Entry points181 └── Data flows1821832. DISCOVERY184 └── Identify potential issues185 ├── Configuration review186 ├── Dependency analysis187 └── Code pattern search1881893. ANALYSIS190 └── Validate and prioritize191 ├── False positive elimination192 ├── Risk scoring193 └── Attack chain mapping1941954. REPORTING196 └── Actionable findings197 ├── Clear reproduction steps198 ├── Business impact199 └── Remediation guidance200```201202---203204## 8. Code Pattern Analysis205206### High-Risk Patterns207208| Pattern | Risk | Look For |209|---------|------|----------|210| **String concat in queries** | Injection | `"SELECT * FROM " + user_input` |211| **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` |212| **Unsafe deserialization** | RCE | `pickle.loads()`, `unserialize()` |213| **Path manipulation** | Traversal | User input in file paths |214| **Disabled security** | Various | `verify=False`, `--insecure` |215216### Secret Patterns217218| Type | Indicators |219|------|-----------|220| API Keys | `api_key`, `apikey`, high entropy |221| Tokens | `token`, `bearer`, `jwt` |222| Credentials | `password`, `secret`, `key` |223| Cloud | `AWS_`, `AZURE_`, `GCP_` prefixes |224225---226227## 9. Cloud Security Considerations228229### Shared Responsibility230231| Layer | You Own | Provider Owns |232|-------|---------|---------------|233| Data | ✅ | ❌ |234| Application | ✅ | ❌ |235| OS/Runtime | Depends | Depends |236| Infrastructure | ❌ | ✅ |237238### Cloud-Specific Checks239240- IAM: Least privilege applied?241- Storage: Public buckets?242- Network: Security groups tightened?243- Secrets: Using secrets manager?244245---246247## 10. Anti-Patterns248249| ❌ Don't | ✅ Do |250|----------|-------|251| Scan without understanding | Map attack surface first |252| Alert on every CVE | Prioritize by exploitability + asset |253| Ignore false positives | Maintain verified baseline |254| Fix symptoms only | Address root causes |255| Scan once before deploy | Continuous scanning |256| Trust third-party deps blindly | Verify integrity, audit code |257258---259260## 11. Reporting Principles261262### Finding Structure263264Each finding should answer:2651. **What?** - Clear vulnerability description2662. **Where?** - Exact location (file, line, endpoint)2673. **Why?** - Root cause explanation2684. **Impact?** - Business consequence2695. **How to fix?** - Specific remediation270271### Severity Classification272273| Severity | Criteria |274|----------|----------|275| **Critical** | RCE, auth bypass, mass data exposure |276| **High** | Data exposure, privilege escalation |277| **Medium** | Limited scope, requires conditions |278| **Low** | Informational, best practice |279280---281282> **Remember:** Vulnerability scanning finds issues. Expert thinking prioritizes what matters. Always ask: "What would an attacker do with this?"283284## When to Use285286Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization.287288Covers: 🔧 Runtime Scripts, 📋 Reference Files, Security Expert Mindset, Core Principles, Threat Modeling Questions.