{"record":{"id":"6ee3b92bb90aab30","repo":"jackwener/OpenCLI","slug":"nvd-cve","errorCode":"nvd cve","errorMessage":"NVD has no record for \"${id}\".","messagePattern":"NVD has no record for \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/nvd/cve.js","lineNumber":103,"sourceCode":"            throw new CommandExecutionError(\n                'nvd cve returned HTTP 429 (rate limited)',\n                'NVD throttles unauthenticated traffic; wait several seconds before retry.',\n            );\n        }\n        if (!resp.ok) {\n            throw new CommandExecutionError(`nvd cve returned HTTP ${resp.status}`);\n        }\n        let body;\n        try {\n            body = await resp.json();\n        }\n        catch (err) {\n            throw new CommandExecutionError(`nvd cve returned malformed JSON: ${err?.message ?? err}`);\n        }\n        const list = Array.isArray(body?.vulnerabilities) ? body.vulnerabilities : [];\n        const cve = list[0]?.cve;\n        if (!cve || !cve.id) {\n            throw new EmptyResultError('nvd cve', `NVD has no record for \"${id}\".`);\n        }\n        const cvss = pickPrimaryCvss(cve.metrics);\n        const cvssData = cvss?.cvssData ?? {};\n        return [{\n            id: String(cve.id),\n            published: String(cve.published ?? '').slice(0, 10),\n            lastModified: String(cve.lastModified ?? '').slice(0, 10),\n            vulnStatus: String(cve.vulnStatus ?? ''),\n            baseScore: cvssData.baseScore != null ? Number(cvssData.baseScore) : null,\n            severity: String(cvssData.baseSeverity ?? cvss?.baseSeverity ?? ''),\n            attackVector: String(cvssData.attackVector ?? ''),\n            cwe: joinCwes(cve.weaknesses),\n            kevAdded: cve.cisaExploitAdd ? String(cve.cisaExploitAdd).slice(0, 10) : '',\n            description: pickEnglishDescription(cve.descriptions),\n            url: `https://nvd.nist.gov/vuln/detail/${cve.id}`,\n        }];\n    },\n});","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/nvd/cve.js#L85-L121","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nnvd cve \"CVE-2021-4428\"\n// after (correct digits)\nnvd cve \"CVE-2021-44228\"","handlingStrategy":"fallback","validationCode":"// sanity check id before calling\nif (!/^CVE-\\d{4}-\\d{4,}$/.test(id)) throw new Error('bad id');","typeGuard":"const isPlausibleCveId = (v) => /^CVE-\\d{4}-\\d{4,}$/i.test(String(v));","tryCatchPattern":"try { return await nvdCve(id); } catch (e) { if (e.code === 'nvd cve' && /no record/.test(e.message)) return lookupElsewhere(id); throw e; }","preventionTips":["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."],"tags":["empty-result","not-found","cve","nvd"],"backgroundTag":"record-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}