Environment:0x4m4 Hexstrike ai Network Access NVD
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, CVE_Intelligence, Network |
| Last Updated | 2026-10-10 00:00 GMT |
Overview
Network environment with outbound HTTPS access to the NVD (National Vulnerability Database) API v2.0 for CVE fetching and exploitability analysis.
Description
This environment provides network connectivity to the NVD API v2.0 endpoint at https://services.nvd.nist.gov/rest/json/cves/2.0. The CVEIntelligenceManager uses this API for two operations: fetching recent CVEs (fetch_latest_cves) and analyzing individual CVE exploitability (analyze_cve_exploitability). The NVD API requires rate limiting compliance: unauthenticated requests must be spaced at least 6 seconds apart. All requests use a 30-second timeout. If the NVD API returns no results or fails, the system falls back to a broader 7-day search for critical CVEs.
Usage
Use this environment when running CVE intelligence workflows: monitoring recent vulnerabilities, analyzing exploit potential, or searching for existing exploits. Required by the CVEIntelligenceManager implementation.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Any (Linux preferred) | Network access is OS-independent |
| Hardware | Minimal | API calls are lightweight |
| Network | Outbound HTTPS to services.nvd.nist.gov | Port 443; firewall must allow |
Dependencies
System Packages
- None beyond the base Python environment
Python Packages
- `requests` >= 2.31.0, < 3.0.0
- See Environment:0x4m4_Hexstrike_ai_Python_3_8_Plus for base dependencies
Credentials
No API key required for basic NVD API v2.0 access. However:
- Unauthenticated requests are rate-limited to 5 requests per 30 seconds
- An NVD API key (optional) increases the rate limit to 50 requests per 30 seconds
- `NVD_API_KEY` (optional): NVD API key for higher rate limits
Quick Install
# No additional packages needed beyond requests
pip install requests>=2.31.0,<3.0.0
# Verify network access:
curl -s "https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=1" | python3 -m json.tool
Code Evidence
NVD API endpoint from `hexstrike_server.py:5969`:
nvd_url = "https://services.nvd.nist.gov/rest/json/cves/2.0"
Rate limiting compliance from `hexstrike_server.py:5984`:
# Add delay to respect NVD rate limits (6 seconds between requests for unauthenticated)
import time
Rate limit sleep on fallback search from `hexstrike_server.py:6097`:
time.sleep(6) # Rate limit compliance
response = requests.get(nvd_url, params=broader_params, timeout=30)
API request with timeout from `hexstrike_server.py:5988`:
response = requests.get(nvd_url, params=params, timeout=30)
Fallback search on empty results from `hexstrike_server.py:6083-6094`:
if not all_cves:
logger.info("No recent CVEs found, checking for any recent critical CVEs...")
broader_start = (datetime.now() - timedelta(days=7)).strftime('%Y-%m-%dT%H:%M:%S.000')
broader_params = {
'lastModStartDate': broader_start,
'lastModEndDate': end_date_str,
'cvssV3Severity': 'CRITICAL',
'resultsPerPage': 20
}
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `requests.exceptions.ConnectionError` | No network access or firewall blocking | Verify outbound HTTPS to services.nvd.nist.gov |
| `HTTP 403 Forbidden` | Rate limit exceeded | Add 6+ second delays between requests; use NVD API key |
| `HTTP 404` for specific CVE | CVE ID not found in NVD | Check CVE ID format (CVE-YYYY-NNNNN) |
| `TimeoutError` after 30s | NVD API slow or unreachable | Increase timeout or retry with backoff |
Compatibility Notes
- Unauthenticated access: Limited to 5 requests per 30 seconds; 6-second delay enforced in code.
- Authenticated access: With NVD API key, up to 50 requests per 30 seconds.
- NVD API v2.0: Current API version; v1.0 is deprecated.
- CVSS version preference: Code prefers CVSS v3.1, falls back to v3.0, then v2.0.
- Corporate firewalls: May block access to nvd.nist.gov; whitelist the domain.