jackwener/OpenCLI · warning · EmptyResultError
nvd cve
nvd cve
Error message
NVD has no record for "${id}". What it means
An EmptyResultError with code "nvd cve" thrown when NVD's response parsed fine but contains no vulnerability record for the requested id — body.vulnerabilities is empty or list[0].cve.id is missing. The library treats this as a definitive "NVD has no record" answer rather than a failure of transport.
Source
Thrown at clis/nvd/cve.js:103
throw new CommandExecutionError(
'nvd cve returned HTTP 429 (rate limited)',
'NVD throttles unauthenticated traffic; wait several seconds before retry.',
);
}
if (!resp.ok) {
throw new CommandExecutionError(`nvd cve returned HTTP ${resp.status}`);
}
let body;
try {
body = await resp.json();
}
catch (err) {
throw new CommandExecutionError(`nvd cve returned malformed JSON: ${err?.message ?? err}`);
}
const list = Array.isArray(body?.vulnerabilities) ? body.vulnerabilities : [];
const cve = list[0]?.cve;
if (!cve || !cve.id) {
throw new EmptyResultError('nvd cve', `NVD has no record for "${id}".`);
}
const cvss = pickPrimaryCvss(cve.metrics);
const cvssData = cvss?.cvssData ?? {};
return [{
id: String(cve.id),
published: String(cve.published ?? '').slice(0, 10),
lastModified: String(cve.lastModified ?? '').slice(0, 10),
vulnStatus: String(cve.vulnStatus ?? ''),
baseScore: cvssData.baseScore != null ? Number(cvssData.baseScore) : null,
severity: String(cvssData.baseSeverity ?? cvss?.baseSeverity ?? ''),
attackVector: String(cvssData.attackVector ?? ''),
cwe: joinCwes(cve.weaknesses),
kevAdded: cve.cisaExploitAdd ? String(cve.cisaExploitAdd).slice(0, 10) : '',
description: pickEnglishDescription(cve.descriptions),
url: `https://nvd.nist.gov/vuln/detail/${cve.id}`,
}];
},
});View on GitHub (pinned to 49907e53dc)
Solutions
- Double-check the CVE id against the source (advisory, changelog, vendor bulletin).
- Verify on cve.org / cve.mitre.org whether the id is real, reserved, or rejected.
- If the CVE was published very recently, retry later — NVD enrichment lags publication.
- Use NVD keyword search instead of cveId lookup when unsure of the exact id.
Example fix
// before nvd cve "CVE-2021-4428" // after (correct digits) nvd cve "CVE-2021-44228"
Defensive patterns
Strategy: fallback
Validate before calling
// sanity check id before calling
if (!/^CVE-\d{4}-\d{4,}$/.test(id)) throw new Error('bad id'); Type guard
const isPlausibleCveId = (v) => /^CVE-\d{4}-\d{4,}$/i.test(String(v)); Try / catch
try { return await nvdCve(id); } catch (e) { if (e.code === 'nvd cve' && /no record/.test(e.message)) return lookupElsewhere(id); throw e; } Prevention
- Cross-check CVE ids against cve.org before automation.
- Treat EmptyResultError as "id may not exist", not an outage.
- For very new CVEs, retry later — NVD lags publication.
- Keep a fallback source (vendor advisories, OSV) for missing ids.
When it happens
Trigger: Querying a syntactically valid but non-existent CVE id (e.g. CVE-2099-00001), a rejected/withdrawn CVE not in the CVE list, or an id with an impossible sequence number that NVD never assigned.
Common situations: Typos in a CVE id copied from a report, fabricating ids from ticket numbers, querying CVEs reserved but never published, or NVD ingest lag for very recently published CVEs.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- bilibili creator-stats ${bvid}
- Chess.com returned 404 for ${url}
- crates crate
- crates.io returned 404 for ${url}.
- Photo ID ${requestedPhotoId} was not found under subject ${s
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/6ee3b92bb90aab30.
Report an issue: GitHub.