بنقرة واحدة
analyze-cve
Analyze CVE vulnerability applicability and generate VEX assessment
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Analyze CVE vulnerability applicability and generate VEX assessment
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | analyze-cve |
| description | Analyze CVE vulnerability applicability and generate VEX assessment |
This skill provides instructions for analyzing whether a CVE (Common Vulnerabilities and Exposures) vulnerability applies to a codebase, and generating appropriate VEX (Vulnerability Exploitability eXchange) documentation.
Use this skill when you need to:
When analyzing a CVE, follow these steps:
Read and understand the CVE details:
Search the codebase to understand how the affected dependency is used:
Determine if the vulnerability applies based on:
Not Affected - Use when:
code_not_reachable: The vulnerable function/code path is never calledcode_not_present: The vulnerable code was removed or never includedrequires_configuration: Vulnerability requires specific config not presentrequires_dependency: Vulnerability requires another dependency not presentrequires_environment: Vulnerability requires specific environment not presentprotected_by_compiler: Compiler/runtime protections prevent exploitationprotected_by_mitigating_control: Other security controls prevent exploitationAffected - Use when:
Under Investigation - Use when:
Fixed - Use when:
For each CVE, record:
Generate a CycloneDX 1.6 VEX document with this structure:
{
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"version": 1,
"metadata": {
"timestamp": "<ISO 8601 timestamp>",
"tools": [
{
"vendor": "patch-inator",
"name": "analyze-cve",
"version": "1.0.0"
}
]
},
"vulnerabilities": [
{
"id": "<CVE-ID>",
"source": {
"name": "NVD",
"url": "https://nvd.nist.gov/vuln/detail/<CVE-ID>"
},
"ratings": [
{
"source": { "name": "NVD" },
"score": <CVSS score>,
"severity": "<critical|high|medium|low>",
"method": "CVSSv3"
}
],
"description": "<Brief description of the vulnerability>",
"analysis": {
"state": "<not_affected|affected|fixed|under_investigation>",
"justification": "<code_not_reachable|code_not_present|requires_configuration|requires_dependency|requires_environment|protected_by_compiler|protected_by_mitigating_control>",
"detail": "<Detailed explanation of why this assessment was made>",
"response": ["<will_not_fix|update|workaround_available|none>"]
},
"affects": [
{
"ref": "<PURL of affected component>"
}
],
"recommendation": "<Recommended action if any>"
}
]
}
PURL Format: Package URLs should follow the PURL specification:
pkg:npm/package-name@versionpkg:pypi/package-name@versionpkg:maven/group-id/artifact-id@versionpkg:golang/module-path@versionGenerate a human-readable markdown report for docs/security/:
# Security Analysis: <CVE-ID>
**Date**: <YYYY-MM-DD>
**Analyst**: patch-inator
**Status**: <Not Affected | Affected | Under Investigation | Fixed>
## Vulnerability Summary
| Field | Value |
|-------|-------|
| CVE ID | <CVE-ID> |
| Severity | <Critical/High/Medium/Low> |
| CVSS Score | <score> |
| Affected Package | <package-name> |
| Affected Versions | <version range> |
| Installed Version | <current version> |
## Description
<Brief description of what the vulnerability is and how it could be exploited>
## Analysis
### Dependency Usage
<Explain how the affected package is used in this codebase>
### Vulnerable Code Path
<Analysis of whether the vulnerable code path is reachable>
### Assessment
**Status**: <status>
**Justification**: <justification reason>
<Detailed explanation of the assessment>
## Evidence
<List of files examined, code snippets analyzed, etc.>
## Recommendation
<What action (if any) should be taken>
## References
- [NVD Entry](https://nvd.nist.gov/vuln/detail/<CVE-ID>)
- [GitHub Advisory](https://github.com/advisories/<GHSA-ID>) (if applicable)
- <Other relevant links>
.patch-inator/vex/<CVE-ID>.vex.cdx.jsondocs/security/<YYYY-MM-DD>-<CVE-ID>.md{
"cve_id": "CVE-2024-1234",
"package": "lodash",
"version": "4.17.20",
"severity": "high",
"cvss": 7.5,
"description": "Prototype pollution in lodash.set() function",
"affected_versions": "< 4.17.21",
"advisory_url": "https://nvd.nist.gov/vuln/detail/CVE-2024-1234"
}
Search for lodash usage:
grep -r "require.*lodash\|import.*lodash" --include="*.js" --include="*.ts"
Find lodash.set() calls:
grep -r "\.set\s*(" --include="*.js" --include="*.ts"
Analyze if prototype pollution is exploitable based on:
Is the vulnerable function (set) called?
├─ No → NOT AFFECTED (code_not_reachable)
└─ Yes → Is user input passed to it?
├─ No → NOT AFFECTED (requires_configuration)
└─ Yes → Is input validated?
├─ Yes, sufficiently → NOT AFFECTED (protected_by_mitigating_control)
└─ No → AFFECTED (needs remediation)
.patch-inator/state.jsonUpdate the patch-inator state after analysis:
# Source state utilities
source scripts/utils/state.sh
# Update analysis status
state_set "analyses.${CVE_ID}.status" "completed"
state_set "analyses.${CVE_ID}.result" "not_affected"
state_set_timestamp "analyses.${CVE_ID}.completed_at"
scripts/vex/generate.sh - Generate VEX documentsscripts/vex/generate-report.sh - Generate markdown reportsscripts/sbom/merge-vex.sh - Merge VEX back into SBOMscripts/pr/create.sh - Create PR with VEX and report