Security Analysis Framework
Perform a comprehensive security vulnerability scan and analysis of the current project. Identifies the technology stack, scans for vulnerabilities in source code and dependencies, assesses real-world risk with context-aware analysis, and produces an actionable remediation roadmap.
Conditional-Load Confirmation
paths: does not auto-run this skill — it only makes the skill loadable once you (Claude) have touched one of the listed manifest files with a Read, Edit, or Write tool call this session (see ADR-0012). If you then choose to invoke this skill on your own initiative because you noticed such a manifest was touched — rather than the user directly asking for /security-analysis — confirm first with AskUserQuestion:
{
"questions": [
{
"question": "A dependency manifest file was changed (package.json, pyproject.toml, Cargo.toml, go.mod, requirements.txt, or Gemfile). Run a security scan now? This audits dependencies for known CVEs and may take 1-15 minutes depending on project size.",
"header": "Security",
"multiSelect": false,
"options": [
{
"label": "Yes - dependencies only",
"description": "Faster scan targeting the changed manifests only (--dependencies-only). Skips deep taint analysis and fuzzing methodology review."
},
{
"label": "Yes - full scan",
"description": "Complete scan: tech-stack detection, dependency audit, source-code patterns, taint analysis, and fuzzing methodology review."
},
{
"label": "No",
"description": "Nothing is scanned; you can run /security-analysis manually at any time."
}
]
}
]
}
- "Yes - dependencies only": proceed with the full scan using the instructions below, passing
--dependencies-only (the default for this path — faster; targets the changed manifests).
- "Yes - full scan": proceed with the full scan using the instructions below with no
--dependencies-only flag (complete scan).
- "No": respond with "Security scan skipped. You can run
/security-analysis manually at any time." and exit immediately — do not perform any scanning.
A separate --quick surface-only mode (tech detection, dependency audit, top-level patterns only — see Input Validation below) remains available as a manual override on direct invocation; it is not one of the confirmation options above.
When invoked directly by the user, skip this prompt and proceed immediately.
Input Validation
Optional Arguments:
<path> - Directory or file path to analyze (defaults to current working directory)
--quick - Surface scan only: technology detection, dependency audit, and top-level code patterns. Skips deep taint analysis and fuzzing methodology review.
--dependencies-only - Only check dependency vulnerabilities (skip source code analysis)
Usage:
/security-analysis # Full scan of current project
/security-analysis src/ # Scan specific directory
/security-analysis --quick # Fast surface-level scan
/security-analysis --dependencies-only # Dependencies only
Performance
| Scan Mode |
Expected Duration |
Notes |
Quick (--quick) |
1-3 minutes |
Technology detection, dependency audit, surface-level code patterns |
| Full scan |
5-15 minutes |
Deep taint analysis, data flow tracing, comprehensive code review |
Dependencies-only (--dependencies-only) |
1-2 minutes |
Native audit tools and known CVE checks |
Duration scales with codebase size (file count and total LOC). Web searches for CVE verification add latency when network-dependent lookups are required.
Scope vs /security-review
|
/security-review (native) |
/security-analysis (this skill) |
| What it covers |
Pending changes — staged diffs and files you're about to commit |
Full project: all source files, all dependencies, transitive CVEs |
| When it runs |
Pre-commit, ad hoc on in-progress work |
On-demand; before releases, after dependency updates, on new repos |
| Depth |
Focused review of modified lines |
Deep taint analysis, data flow tracing, OWASP Top 10 sweep |
| Duration |
Seconds to ~1 minute |
1–15 minutes depending on mode and codebase size |
Routing guidance: Use /security-review when you want a fast check on what you're about to ship. Use this skill (/security-analysis) when you need full-project assurance — dependency CVE audit, static analysis across the entire codebase, and a prioritized remediation roadmap.
Core Security Analysis Process
Phase 1: Discovery and Reconnaissance
- Technology Stack Detection: Identify languages, frameworks, and dependencies by scanning for manifest files (package.json, requirements.txt, pom.xml, go.mod, Cargo.toml, etc.)
- Attack Surface Mapping: Enumerate all entry points (APIs, forms, file uploads, CLI arguments, environment variables)
- Dependency Inventory: List all direct and transitive dependencies with version numbers
- Configuration Review: Check for security-relevant configurations (CORS, CSP, auth settings)
Phase 2: Vulnerability Scanning
A. Static Code Analysis
Scan source code for OWASP Top 10 and common vulnerability patterns:
- Injection Vulnerabilities: SQL, NoSQL, Command, LDAP, XPath, Template injection
- Broken Authentication: Weak password policies, session fixation, credential storage
- Sensitive Data Exposure: Hardcoded secrets, unencrypted data, logging sensitive info
- XML External Entities (XXE): Unsafe XML parsing
- Broken Access Control: Missing authorization checks, IDOR vulnerabilities
- Security Misconfiguration: Default credentials, unnecessary features enabled
- Cross-Site Scripting (XSS): Reflected, Stored, DOM-based
- Insecure Deserialization: Unsafe object deserialization
- Using Components with Known Vulnerabilities: Outdated dependencies
- Insufficient Logging and Monitoring: Missing security event logging
B. Dependency Vulnerability Analysis
IMPORTANT: Always run native security audit tools FIRST before web search for faster and more accurate results.
For each dependency:
- Extract Version Information: From package manifests
- Run Native Security Audit Tools (Primary Method):
- Node.js/JavaScript:
npm audit or npm audit --json
- Python:
pip-audit or safety check
- Java/Maven:
mvn dependency-check:check
- Java/Gradle:
./gradlew dependencyCheckAnalyze
- .NET:
dotnet list package --vulnerable
- PHP/Composer:
composer audit
- Ruby:
bundle audit check
- Rust:
cargo audit
- Go:
govulncheck ./...
- Parse Audit Results: Extract CVE IDs, severity levels, and affected versions from tool output
- Web Search for CVEs (Secondary/Verification Method): NVD, Snyk, GitHub Security Advisories
- Check Latest Versions: Compare against current stable releases
- Assess Severity: Use CVSS scores and exploit availability
- Verify Patch Availability: Check if fixes exist and are stable
C. Context-Aware Analysis
For each identified vulnerability:
- Code Path Tracing: Is the vulnerable code actually used?
- Import Analysis: Are vulnerable functions imported?
- Call Graph Analysis: Are vulnerable methods called?
- Data Flow Analysis: Does user input reach vulnerable code?
- Environment Context: Is this a dev-only or production dependency?
Phase 3: Advanced Vulnerability Discovery
Skip this phase if --quick flag is set.
A. Taint Analysis and Data Flow Tracing
- Identify Sources: Map all entry points (
req.body, argv, params, headers)
- Identify Sinks: Map dangerous functions (
eval(), exec(), innerHTML, SQL execution)
- Trace Flow: Trace if input reaches a sink without a sanitizer step
- Zero Tolerance: If ANY user input reaches a sensitive sink without strict validation, flag as CRITICAL
B. Logic Abusability
- Race Conditions: Identify concurrent state updates (db transactions, file writes)
- Business Logic: Can you buy an item for $0? Can you access data ID+1?
- State Manipulation: Can you skip a step in a multi-step flow?
C. Data Compromise Check
- Leakage: Are PII, secrets, or internal IDs exposed in logs, error messages, or API responses?
- Integrity: Can data be modified without authorization?
- Availability: Can a payload cause a crash or high resource consumption (DoS)?
Phase 4: Risk Assessment
Severity Classification
CRITICAL (CVSS 9.0-10.0)
- Remote code execution
- Authentication bypass
- SQL injection in production endpoints
- Exposed secrets/credentials
HIGH (CVSS 7.0-8.9)
- Privilege escalation
- Sensitive data exposure
- XSS in authenticated areas
- Known exploits available
MEDIUM (CVSS 4.0-6.9)
- CSRF vulnerabilities
- Information disclosure
- Weak cryptography
- Outdated dependencies with patches available
LOW (CVSS 0.1-3.9)
- Minor information leaks
- Deprecated functions
- Code quality issues with security implications
INFO (CVSS 0.0)
- Security best practice recommendations
- Hardening opportunities
- Awareness items
Risk Factors
- Exploitability: How easy to exploit? (Automated, Simple, Complex, Theoretical)
- Impact: What's at risk? (Data breach, Service disruption, Financial loss)
- Scope: What's affected? (Single user, All users, System-wide)
- Exposure: Who can exploit? (Internet, Authenticated users, Admins only)
Phase 5: Remediation Planning
Remediation Strategies
Immediate Fixes (Critical/High)
- Version upgrades with compatibility verification
- Code patches with security testing
- Configuration hardening
- Temporary mitigations (WAF rules, input validation)
Scheduled Fixes (Medium)
- Plan for next sprint/release
- Coordinate with feature development
- Comprehensive testing required
Long-term Improvements (Low/Info)
- Architectural refactoring
- Security framework adoption
- Developer training needs
Upgrade Guidance Template
Package: [name]
Current Version: [x.y.z]
Vulnerable: YES
CVE: [CVE-YYYY-NNNNN]
Severity: [LEVEL]
Fixed In: [a.b.c]
Latest Stable: [p.q.r]
Breaking Changes: [YES/NO]
Migration Guide: [URL]
Recommendation: Upgrade to [version] - [reason]
Technology-Specific Security Patterns
For detailed vulnerability signatures and check patterns by language/framework, refer to the reference files in the plugin's references/ directory. The following summaries indicate key focus areas per stack:
| Technology |
Key Focus Areas |
| Node.js/JavaScript |
Prototype pollution, RegEx DoS, dependency confusion, npm hijacking |
| Python |
Pickle deserialization, SQL injection, SSTI, XML vulnerabilities |
| PHP |
RCE, file inclusion, type juggling, deserialization |
| Go |
SQL injection, command injection, race conditions, unsafe reflection |
| Java/Kotlin |
Deserialization, XXE, SSRF, Spring vulnerabilities |
| .NET/C# |
Deserialization, SQL injection, XSS, CSRF |
| Rust |
Unsafe code blocks, memory safety, dependency vulnerabilities |
| React/Frontend |
XSS, CSRF, sensitive data exposure, dependency vulnerabilities |
| React Native/Mobile |
Insecure storage, weak crypto, API key exposure, deep linking |
| Vue.js |
XSS via v-html, template injection, dependency vulnerabilities |
| NestJS |
Injection attacks, authentication bypass, authorization flaws |
| Next.js |
Server-side vulnerabilities, API route security, SSR/SSG security |
Web Search Strategy for Vulnerability Intelligence
Required Searches
For each dependency with suspected vulnerabilities, perform:
- CVE Search:
"[package-name]" CVE [current-year] [previous-year]
- Security Advisory:
"[package-name]" security advisory vulnerability
- Version Check:
"[package-name]" latest stable version
- Known Exploits:
"[package-name]" exploit proof of concept
Trusted Sources
- NVD (nvd.nist.gov)
- Snyk Vulnerability Database
- GitHub Security Advisories
- npm/PyPI/Maven/NuGet security pages
- OWASP resources
Output
Output Location: Write security report to reports/security-analysis-[YYYYMMDD-HHMMSS].md
Security Report Structure
# Security Analysis Report
Generated: [timestamp]
Project: [name]
Scan Scope: [files/dependencies scanned]
Scan Mode: [Full / Quick / Dependencies-Only]
## Executive Summary
- Total Vulnerabilities: [count]
- Critical: [count] | High: [count] | Medium: [count] | Low: [count]
- Immediate Action Required: [YES/NO]
## Critical Findings
[List of critical vulnerabilities requiring immediate attention]
## Detailed Analysis
### File-Level Vulnerabilities
[Per-file security issues with code snippets and line numbers]
### Dependency Vulnerabilities
[Per-package analysis with CVE details and upgrade paths]
### Context-Aware Risk Assessment
[Analysis of which vulnerabilities are actually exploitable in this codebase]
## Remediation Roadmap
### Immediate (0-24 hours)
[Critical fixes]
### Short-term (1-7 days)
[High priority fixes]
### Medium-term (1-4 weeks)
[Medium priority improvements]
### Long-term (1-3 months)
[Low priority and architectural improvements]
## Verification Steps
[How to test that fixes work correctly]
## References
[Links to CVE databases, security advisories, documentation]
Examples
Full scan of a Node.js project:
/security-analysis
Output: A comprehensive report at reports/security-analysis-20260304-141522.md covering dependency CVEs from npm audit, static code analysis for XSS and injection patterns, and a prioritized remediation roadmap.
Quick scan of a specific directory:
/security-analysis src/api/ --quick
Output: Surface-level scan covering technology detection, dependency audit, and top-level code patterns for the src/api/ directory only. Skips deep taint analysis.
Dependencies-only audit before a release:
/security-analysis --dependencies-only
Output: Runs npm audit / pip-audit / native tools for all detected package manifests. Reports known CVEs with severity, affected versions, and upgrade paths. No source code analysis performed.
Typical report summary:
Security Analysis Report
========================
Total Vulnerabilities: 7
Critical: 0 | High: 2 | Medium: 3 | Low: 2
Immediate Action Required: YES
Critical Findings: None
High Findings:
- express@4.17.1: CVE-2024-XXXXX (path traversal) — upgrade to 4.21.0+
- jsonwebtoken@8.5.1: CVE-2022-23529 (insecure default) — upgrade to 9.0.0+
Error Handling
| Error |
Cause |
Resolution |
| No source files found |
Empty directory or path doesn't exist |
Verify the target path contains source code; check for typos |
| Project too large |
Thousands of files causing timeouts |
Use --quick for surface scan, or specify a subdirectory path to narrow scope |
| Audit tool not installed |
npm audit, pip-audit, etc. not available |
Report which tool is needed and provide installation command; fall back to web search for CVEs |
| Permission denied |
Cannot read files in target directory |
Report the inaccessible paths; suggest checking file permissions |
| No package manifest found |
No package.json, requirements.txt, etc. |
Skip dependency analysis; focus on static code analysis only |
| Network unavailable |
Cannot reach CVE databases for web search |
Use only local audit tools and static analysis; note that CVE verification was skipped |
Best Practices
- Always verify vulnerability information from multiple sources
- Consider the specific context of the application
- Provide clear, actionable remediation steps
- Include code examples for fixes
- Link to official documentation
- Respect responsible disclosure practices
- Focus on practical, implementable solutions
1---2name: security-analysis3description: Comprehensive security analysis with tech stack detection, vulnerability scanning, and remediation planning. Suggest when — security/vulnerabilities/CVEs/audit mentioned, new projects scaffolded, before releases/deployments/production, auth/input-handling code review, dependency updates, or new repos cloned.4---56# Security Analysis Framework78Perform a comprehensive security vulnerability scan and analysis of the current project. Identifies the technology stack, scans for vulnerabilities in source code and dependencies, assesses real-world risk with context-aware analysis, and produces an actionable remediation roadmap.910## Conditional-Load Confirmation1112`paths:` does not auto-run this skill — it only makes the skill loadable once you (Claude) have touched one of the listed manifest files with a Read, Edit, or Write tool call this session (see [ADR-0012](../../../../docs/adr/0012-artifact-derived-documentation.md)). If you then choose to invoke this skill on your own initiative because you noticed such a manifest was touched — rather than the user directly asking for `/security-analysis` — confirm first with `AskUserQuestion`:1314```json15{16 "questions": [17 {18 "question": "A dependency manifest file was changed (package.json, pyproject.toml, Cargo.toml, go.mod, requirements.txt, or Gemfile). Run a security scan now? This audits dependencies for known CVEs and may take 1-15 minutes depending on project size.",19 "header": "Security",20 "multiSelect": false,21 "options": [22 {23 "label": "Yes - dependencies only",24 "description": "Faster scan targeting the changed manifests only (--dependencies-only). Skips deep taint analysis and fuzzing methodology review."25 },26 {27 "label": "Yes - full scan",28 "description": "Complete scan: tech-stack detection, dependency audit, source-code patterns, taint analysis, and fuzzing methodology review."29 },30 {31 "label": "No",32 "description": "Nothing is scanned; you can run /security-analysis manually at any time."33 }34 ]35 }36 ]37}38```3940- **"Yes - dependencies only":** proceed with the full scan using the instructions below, passing `--dependencies-only` (the default for this path — faster; targets the changed manifests).41- **"Yes - full scan":** proceed with the full scan using the instructions below with no `--dependencies-only` flag (complete scan).42- **"No":** respond with "Security scan skipped. You can run `/security-analysis` manually at any time." and exit immediately — do not perform any scanning.4344A separate `--quick` surface-only mode (tech detection, dependency audit, top-level patterns only — see Input Validation below) remains available as a manual override on direct invocation; it is not one of the confirmation options above.4546When invoked directly by the user, skip this prompt and proceed immediately.4748---4950## Input Validation5152**Optional Arguments:**53- `<path>` - Directory or file path to analyze (defaults to current working directory)54- `--quick` - Surface scan only: technology detection, dependency audit, and top-level code patterns. Skips deep taint analysis and fuzzing methodology review.55- `--dependencies-only` - Only check dependency vulnerabilities (skip source code analysis)5657**Usage:**58```text59/security-analysis # Full scan of current project60/security-analysis src/ # Scan specific directory61/security-analysis --quick # Fast surface-level scan62/security-analysis --dependencies-only # Dependencies only63```6465## Performance6667| Scan Mode | Expected Duration | Notes |68|-----------|-------------------|-------|69| Quick (`--quick`) | 1-3 minutes | Technology detection, dependency audit, surface-level code patterns |70| Full scan | 5-15 minutes | Deep taint analysis, data flow tracing, comprehensive code review |71| Dependencies-only (`--dependencies-only`) | 1-2 minutes | Native audit tools and known CVE checks |7273Duration scales with codebase size (file count and total LOC). Web searches for CVE verification add latency when network-dependent lookups are required.7475## Scope vs `/security-review`7677| | `/security-review` (native) | `/security-analysis` (this skill) |78|---|---|---|79| **What it covers** | Pending changes — staged diffs and files you're about to commit | Full project: all source files, all dependencies, transitive CVEs |80| **When it runs** | Pre-commit, ad hoc on in-progress work | On-demand; before releases, after dependency updates, on new repos |81| **Depth** | Focused review of modified lines | Deep taint analysis, data flow tracing, OWASP Top 10 sweep |82| **Duration** | Seconds to ~1 minute | 1–15 minutes depending on mode and codebase size |8384**Routing guidance:** Use `/security-review` when you want a fast check on what you're about to ship. Use this skill (`/security-analysis`) when you need full-project assurance — dependency CVE audit, static analysis across the entire codebase, and a prioritized remediation roadmap.8586---8788## Core Security Analysis Process8990### Phase 1: Discovery and Reconnaissance91921. **Technology Stack Detection**: Identify languages, frameworks, and dependencies by scanning for manifest files (package.json, requirements.txt, pom.xml, go.mod, Cargo.toml, etc.)932. **Attack Surface Mapping**: Enumerate all entry points (APIs, forms, file uploads, CLI arguments, environment variables)943. **Dependency Inventory**: List all direct and transitive dependencies with version numbers954. **Configuration Review**: Check for security-relevant configurations (CORS, CSP, auth settings)9697### Phase 2: Vulnerability Scanning9899#### A. Static Code Analysis100101Scan source code for OWASP Top 10 and common vulnerability patterns:102- **Injection Vulnerabilities**: SQL, NoSQL, Command, LDAP, XPath, Template injection103- **Broken Authentication**: Weak password policies, session fixation, credential storage104- **Sensitive Data Exposure**: Hardcoded secrets, unencrypted data, logging sensitive info105- **XML External Entities (XXE)**: Unsafe XML parsing106- **Broken Access Control**: Missing authorization checks, IDOR vulnerabilities107- **Security Misconfiguration**: Default credentials, unnecessary features enabled108- **Cross-Site Scripting (XSS)**: Reflected, Stored, DOM-based109- **Insecure Deserialization**: Unsafe object deserialization110- **Using Components with Known Vulnerabilities**: Outdated dependencies111- **Insufficient Logging and Monitoring**: Missing security event logging112113#### B. Dependency Vulnerability Analysis114115**IMPORTANT**: Always run native security audit tools FIRST before web search for faster and more accurate results.116117For each dependency:1181. **Extract Version Information**: From package manifests1192. **Run Native Security Audit Tools** (Primary Method):120 - **Node.js/JavaScript**: `npm audit` or `npm audit --json`121 - **Python**: `pip-audit` or `safety check`122 - **Java/Maven**: `mvn dependency-check:check`123 - **Java/Gradle**: `./gradlew dependencyCheckAnalyze`124 - **.NET**: `dotnet list package --vulnerable`125 - **PHP/Composer**: `composer audit`126 - **Ruby**: `bundle audit check`127 - **Rust**: `cargo audit`128 - **Go**: `govulncheck ./...`1293. **Parse Audit Results**: Extract CVE IDs, severity levels, and affected versions from tool output1304. **Web Search for CVEs** (Secondary/Verification Method): NVD, Snyk, GitHub Security Advisories1315. **Check Latest Versions**: Compare against current stable releases1326. **Assess Severity**: Use CVSS scores and exploit availability1337. **Verify Patch Availability**: Check if fixes exist and are stable134135#### C. Context-Aware Analysis136137For each identified vulnerability:1381. **Code Path Tracing**: Is the vulnerable code actually used?1392. **Import Analysis**: Are vulnerable functions imported?1403. **Call Graph Analysis**: Are vulnerable methods called?1414. **Data Flow Analysis**: Does user input reach vulnerable code?1425. **Environment Context**: Is this a dev-only or production dependency?143144### Phase 3: Advanced Vulnerability Discovery145146Skip this phase if `--quick` flag is set.147148#### A. Taint Analysis and Data Flow Tracing1491. **Identify Sources**: Map all entry points (`req.body`, `argv`, `params`, `headers`)1502. **Identify Sinks**: Map dangerous functions (`eval()`, `exec()`, `innerHTML`, `SQL execution`)1513. **Trace Flow**: Trace if input reaches a sink without a sanitizer step1524. **Zero Tolerance**: If ANY user input reaches a sensitive sink without strict validation, flag as CRITICAL153154#### B. Logic Abusability1551. **Race Conditions**: Identify concurrent state updates (db transactions, file writes)1562. **Business Logic**: Can you buy an item for $0? Can you access data ID+1?1573. **State Manipulation**: Can you skip a step in a multi-step flow?158159#### C. Data Compromise Check1601. **Leakage**: Are PII, secrets, or internal IDs exposed in logs, error messages, or API responses?1612. **Integrity**: Can data be modified without authorization?1623. **Availability**: Can a payload cause a crash or high resource consumption (DoS)?163164### Phase 4: Risk Assessment165166#### Severity Classification167168```text169CRITICAL (CVSS 9.0-10.0)170- Remote code execution171- Authentication bypass172- SQL injection in production endpoints173- Exposed secrets/credentials174175HIGH (CVSS 7.0-8.9)176- Privilege escalation177- Sensitive data exposure178- XSS in authenticated areas179- Known exploits available180181MEDIUM (CVSS 4.0-6.9)182- CSRF vulnerabilities183- Information disclosure184- Weak cryptography185- Outdated dependencies with patches available186187LOW (CVSS 0.1-3.9)188- Minor information leaks189- Deprecated functions190- Code quality issues with security implications191192INFO (CVSS 0.0)193- Security best practice recommendations194- Hardening opportunities195- Awareness items196```197198#### Risk Factors199- **Exploitability**: How easy to exploit? (Automated, Simple, Complex, Theoretical)200- **Impact**: What's at risk? (Data breach, Service disruption, Financial loss)201- **Scope**: What's affected? (Single user, All users, System-wide)202- **Exposure**: Who can exploit? (Internet, Authenticated users, Admins only)203204### Phase 5: Remediation Planning205206#### Remediation Strategies2071. **Immediate Fixes** (Critical/High)208 - Version upgrades with compatibility verification209 - Code patches with security testing210 - Configuration hardening211 - Temporary mitigations (WAF rules, input validation)2122132. **Scheduled Fixes** (Medium)214 - Plan for next sprint/release215 - Coordinate with feature development216 - Comprehensive testing required2172183. **Long-term Improvements** (Low/Info)219 - Architectural refactoring220 - Security framework adoption221 - Developer training needs222223#### Upgrade Guidance Template224```text225Package: [name]226 Current Version: [x.y.z]227 Vulnerable: YES228 CVE: [CVE-YYYY-NNNNN]229 Severity: [LEVEL]230 Fixed In: [a.b.c]231 Latest Stable: [p.q.r]232 Breaking Changes: [YES/NO]233 Migration Guide: [URL]234 Recommendation: Upgrade to [version] - [reason]235```236237## Technology-Specific Security Patterns238239For detailed vulnerability signatures and check patterns by language/framework, refer to the reference files in the plugin's `references/` directory. The following summaries indicate key focus areas per stack:240241| Technology | Key Focus Areas |242|-----------|----------------|243| Node.js/JavaScript | Prototype pollution, RegEx DoS, dependency confusion, npm hijacking |244| Python | Pickle deserialization, SQL injection, SSTI, XML vulnerabilities |245| PHP | RCE, file inclusion, type juggling, deserialization |246| Go | SQL injection, command injection, race conditions, unsafe reflection |247| Java/Kotlin | Deserialization, XXE, SSRF, Spring vulnerabilities |248| .NET/C# | Deserialization, SQL injection, XSS, CSRF |249| Rust | Unsafe code blocks, memory safety, dependency vulnerabilities |250| React/Frontend | XSS, CSRF, sensitive data exposure, dependency vulnerabilities |251| React Native/Mobile | Insecure storage, weak crypto, API key exposure, deep linking |252| Vue.js | XSS via v-html, template injection, dependency vulnerabilities |253| NestJS | Injection attacks, authentication bypass, authorization flaws |254| Next.js | Server-side vulnerabilities, API route security, SSR/SSG security |255256## Web Search Strategy for Vulnerability Intelligence257258### Required Searches259For each dependency with suspected vulnerabilities, perform:2601. **CVE Search**: `"[package-name]" CVE [current-year] [previous-year]`2612. **Security Advisory**: `"[package-name]" security advisory vulnerability`2623. **Version Check**: `"[package-name]" latest stable version`2634. **Known Exploits**: `"[package-name]" exploit proof of concept`264265### Trusted Sources266- NVD (nvd.nist.gov)267- Snyk Vulnerability Database268- GitHub Security Advisories269- npm/PyPI/Maven/NuGet security pages270- OWASP resources271272## Output273274**Output Location:** Write security report to `reports/security-analysis-[YYYYMMDD-HHMMSS].md`275276### Security Report Structure277```markdown278# Security Analysis Report279Generated: [timestamp]280Project: [name]281Scan Scope: [files/dependencies scanned]282Scan Mode: [Full / Quick / Dependencies-Only]283284## Executive Summary285- Total Vulnerabilities: [count]286- Critical: [count] | High: [count] | Medium: [count] | Low: [count]287- Immediate Action Required: [YES/NO]288289## Critical Findings290[List of critical vulnerabilities requiring immediate attention]291292## Detailed Analysis293294### File-Level Vulnerabilities295[Per-file security issues with code snippets and line numbers]296297### Dependency Vulnerabilities298[Per-package analysis with CVE details and upgrade paths]299300### Context-Aware Risk Assessment301[Analysis of which vulnerabilities are actually exploitable in this codebase]302303## Remediation Roadmap304### Immediate (0-24 hours)305[Critical fixes]306307### Short-term (1-7 days)308[High priority fixes]309310### Medium-term (1-4 weeks)311[Medium priority improvements]312313### Long-term (1-3 months)314[Low priority and architectural improvements]315316## Verification Steps317[How to test that fixes work correctly]318319## References320[Links to CVE databases, security advisories, documentation]321```322323## Examples324325**Full scan of a Node.js project:**326```text327/security-analysis328```329Output: A comprehensive report at `reports/security-analysis-20260304-141522.md` covering dependency CVEs from `npm audit`, static code analysis for XSS and injection patterns, and a prioritized remediation roadmap.330331**Quick scan of a specific directory:**332```text333/security-analysis src/api/ --quick334```335Output: Surface-level scan covering technology detection, dependency audit, and top-level code patterns for the `src/api/` directory only. Skips deep taint analysis.336337**Dependencies-only audit before a release:**338```text339/security-analysis --dependencies-only340```341Output: Runs `npm audit` / `pip-audit` / native tools for all detected package manifests. Reports known CVEs with severity, affected versions, and upgrade paths. No source code analysis performed.342343**Typical report summary:**344```text345Security Analysis Report346========================347Total Vulnerabilities: 7348 Critical: 0 | High: 2 | Medium: 3 | Low: 2349 Immediate Action Required: YES350351Critical Findings: None352High Findings:353 - express@4.17.1: CVE-2024-XXXXX (path traversal) — upgrade to 4.21.0+354 - jsonwebtoken@8.5.1: CVE-2022-23529 (insecure default) — upgrade to 9.0.0+355```356357## Error Handling358359| Error | Cause | Resolution |360|-------|-------|------------|361| No source files found | Empty directory or path doesn't exist | Verify the target path contains source code; check for typos |362| Project too large | Thousands of files causing timeouts | Use `--quick` for surface scan, or specify a subdirectory path to narrow scope |363| Audit tool not installed | `npm audit`, `pip-audit`, etc. not available | Report which tool is needed and provide installation command; fall back to web search for CVEs |364| Permission denied | Cannot read files in target directory | Report the inaccessible paths; suggest checking file permissions |365| No package manifest found | No package.json, requirements.txt, etc. | Skip dependency analysis; focus on static code analysis only |366| Network unavailable | Cannot reach CVE databases for web search | Use only local audit tools and static analysis; note that CVE verification was skipped |367368## Best Practices369- Always verify vulnerability information from multiple sources370- Consider the specific context of the application371- Provide clear, actionable remediation steps372- Include code examples for fixes373- Link to official documentation374- Respect responsible disclosure practices375- Focus on practical, implementable solutions