Skip to content

fix: use project version in x_generator for accurate CNA tracking#52

Merged
sei-vsarvepalli merged 3 commits intoCERTCC:mainfrom
jgamblin:fix/x-generator-version
Apr 3, 2026
Merged

fix: use project version in x_generator for accurate CNA tracking#52
sei-vsarvepalli merged 3 commits intoCERTCC:mainfrom
jgamblin:fix/x-generator-version

Conversation

@jgamblin
Copy link
Copy Markdown
Contributor

@jgamblin jgamblin commented Apr 2, 2026

Summary

The x_generator.engine field embedded in every published CVE record has been reporting the wrong version. It was using cveClientlib.js's internal _version (frozen at 1.0.15) instead of the actual project version (1.0.25).

Before: Every CVE record published by cveClient says "engine": "cveClient/1.0.15" — regardless of which release the CNA is actually running.

After: CVE records will correctly report "engine": "cveClient/1.0.25" (or whatever the current release is), using the single _version constant that stays in sync with CHANGELOG.md and package.json.

Why this matters

The x_generator tag is the only way to measure cveClient adoption across the CNA community. With accurate version reporting we can:

  • Track adoption — See how many CNAs are using cveClient and which versions they're on
  • Identify outdated installs — Reach out to CNAs still on older versions with security or compatibility fixes
  • Demonstrate usage — Show the CVE community that cveClient is actively used, which helps justify continued development

Without this fix, every CNA appears to be on 1.0.15 no matter what, making version tracking impossible.

What changed

Three locations in cveInterface.js set x_generator before publishing — during CVE download, CVE publish, and CVE reject. Each was:

if(get_deep(client,'constructor.name') && client._version)
    obj["x_generator"] = {engine: client.constructor.name + "/" + client._version };

Now simplified to:

obj["x_generator"] = {engine: "cveClient/" + _version };

This also removes the unnecessary conditional — the tag should always be set.

Also removes two stale tests for getadp/deleteadp methods that were removed in PR #45.

Test plan

  • All 49 tests pass locally
  • CI passes on this PR

🤖 Generated with Claude Code

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 CERTCC#45.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jgamblin jgamblin force-pushed the fix/x-generator-version branch from 584f656 to 850745b Compare April 2, 2026 19:00
@sei-vsarvepalli
Copy link
Copy Markdown
Collaborator

I think my plan earlier was to use the cveClientLib version independent of the UI version. I can see it is worth capturing the UI version as the UI is building the JSON and the clientlib is universal can be used by Node as well without the UI. So depending on how it was launched we can provide different . Current version actually comes from

this._version = "1.0.15";

jgamblin and others added 2 commits April 2, 2026 20:09
Two use cases for x_generator:

1. Browser UI (cveInterface.js) — sets x_generator to "cveClient/<version>"
   using the project version before calling publishcve()

2. Node.js direct (cveClientlib.js) — publishcve() now injects a default
   x_generator of "cveClientlib/<version>" if the caller didn't set one

This means:
- CVE records published via the UI say "cveClient/1.0.25"
- CVE records published via the Node.js library say "cveClientlib/1.0.15"
- Callers can still set their own x_generator and it won't be overwritten

Addresses review feedback from @sei-vsarvepalli about keeping the
lib version independent from the UI version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…where

All x_generator tags now report as "cveClient/<version>" to match
the existing entries in the CVE corpus. Synced cveClientlib._version
from 1.0.15 to 1.0.25 so both UI and Node.js paths report the same
project version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jgamblin
Copy link
Copy Markdown
Contributor Author

jgamblin commented Apr 3, 2026

Updated based on your feedback @sei-vsarvepalli — here's what changed:

  1. Synced cveClientlib._version from 1.0.15 to 1.0.25 so both paths report the same project version going forward.

  2. Both UI and Node.js paths now report as cveClient/<version> to stay consistent with the existing entries in the CVE corpus:

149 cveClient/1.0.13
112 cveClient/1.0.15
 19 cveClient/1.0.14
  1. publishcve() in cveClientlib.js now injects a default x_generator if the caller doesn't set one — so Node.js users get tracking automatically without needing to know about the field.

  2. The UI-set x_generator is never overwrittencveInterface.js sets it before calling publishcve(), and the lib only fills it in if missing.

Going forward we may want to consider keeping these versions in sync as part of the release process, or pulling from a single source of truth (e.g. package.json).

@sei-vsarvepalli sei-vsarvepalli merged commit 30cb5ff into CERTCC:main Apr 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants