Skip to content

Commit 850745b

Browse files
jgamblinclaude
andcommitted
fix: use project version in x_generator tag for accurate CVE tracking
The x_generator.engine field in published CVE records was using client._version from cveClientlib.js (stuck at 1.0.15) instead of the project version from cveInterface.js (currently 1.0.25). This means every CVE record published by cveClient has been stamped with "cveClient/1.0.15" regardless of the actual version in use. Fixing this allows us to: - Accurately track which version of cveClient CNAs are using - Identify CNAs running outdated versions and reach out about upgrades - Measure adoption of new releases across the CNA community The fix replaces the conditional client._version lookup with the global _version constant that stays in sync with CHANGELOG.md and package.json. Also removes tests for getadp/deleteadp methods that were removed in PR #45. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ac2cf61 commit 850745b

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

cveInterface.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,7 @@ async function download_json() {
639639
orgId: "00000000-0000-0000-0000-000000000000",
640640
shortName: "none",
641641
};
642-
if (get_deep(client, "constructor.name") && client._version)
643-
returnJSON["x_generator"] = {
644-
engine: client.constructor.name + "/" + client._version,
645-
};
642+
returnJSON["x_generator"] = { engine: "cveClient/" + _version };
646643
$("#cveUpdateModal .cveupdate").attr("download", cve + ".json");
647644
let cson = encodeURIComponent(JSON.stringify(returnJSON));
648645
$("#cveUpdateModal .cveupdate").attr(
@@ -1817,10 +1814,7 @@ async function publish_cve() {
18171814
orgId: client.userobj.org_UUID,
18181815
shortName: client.org,
18191816
};
1820-
if (get_deep(client, "constructor.name") && client._version)
1821-
pubcve["x_generator"] = {
1822-
engine: client.constructor.name + "/" + client._version,
1823-
};
1817+
pubcve["x_generator"] = { engine: "cveClient/" + _version };
18241818
let cve = mr.cve_id;
18251819
let ispublic = mr.state != "RESERVED";
18261820
let rejected = false;
@@ -2079,10 +2073,7 @@ async function reject_cve(confirm) {
20792073
orgId: client.userobj.org_UUID,
20802074
shortName: client.org,
20812075
};
2082-
if (get_deep(client, "constructor.name") && client._version)
2083-
rejcve["x_generator"] = {
2084-
engine: client.constructor.name + "/" + client._version,
2085-
};
2076+
rejcve["x_generator"] = { engine: "cveClient/" + _version };
20862077
let cve = mr.cve_id;
20872078
let ispublic = mr.state != "RESERVED";
20882079
let rejected = true;

0 commit comments

Comments
 (0)