fix(vex): a CVE a scan no longer finds is not stated fixed (#994) #1015

Merged
sharang merged 2 commits from fix/vex-not-from-scan into main 2026-11-27 22:23:04 +00:00
Owner

Owner decisions on #994, 2026-11-27: take it up now, with the safe defaults below. Rebased onto main (v0.4.17).

A complete scan that no longer finds a CVE no longer turns it into a VEX fixed, and no reader treats a missing CVE as fixed. Both routes from #994 are closed.

What changes

  • Weg A, setting the status. resolve_gone only sets resolved_at, as the scan's observation. It writes no VEX statement. Each alert keeps the statement it has, and one without stays without.
  • Weg B, reading the export. vex_docs::status_of maps "no statement" to under_investigation, whether or not the CVE is gone.
  • One rule in core: CveAlert::statement(). It ignores the fixed that scans inferred before this change. Such a statement is identified as by_scan, fixed and with no impact_statement. A Yocto recipe's statement always gives its reason, so it still counts.
    • Everything reads through this rule: status_of, is_resolved_by_vex (notifications and tracker issues), the OpenVEX, CycloneDX and CSAF exports, the CVE groups and the ENISA drafts.
  • CVE groups. cve_groups::is_open now checks resolved_at itself, since "gone" and "fixed" are now different things.
  • ENISA.
    • fixed_at, and with it the final-report deadline, comes only from a fixed stated by a person. A gone CVE leaves field v22 and the deadline open.
    • An exploited CVE that is gone but was never seen exploited gets a new Reportability::NoLongerFound with an honest reason. Before, it got "Fixed".
  • Dashboard and MCP. GET /targets/{id}/cves and MCP list_cves drop the inferred statements (CveAlert::drop_inferred_fix), so the dashboard stops showing them. The dashboard's status comes from core status_of.
  • Data. scripts/vex-994-cleanup.js (mongosh) counts the stored inferred statements. It removes them ($unset vex) only with apply = true. It prints counts only and keeps resolved_at.
    • Whether and when the script runs against stage or production is the owner's call. I have only run it against local Mongo.

Inventory (full grep over core, agent, dashboard and MCP)

  • Writers of a VEX statement:

    • the person (handlers/vex.rs, by_scan: false)
    • Yocto (yocto_inventory::scan_statement, used by yocto_inventory and yocto_build, always with an impact_statement)
    • and, before this change, resolve_gone

    So "by_scan + fixed + no impact_statement" matches only what resolve_gone wrote.

  • Readers that bypass statement():

    • cve_matrix (handler), inbox and platform filter resolved_at: null.
    • The re-report path (upsert_reported) withdraws a scan's statement, so a still-reported alert never carries an inferred one.
    • attach_stored_vex copies the stored statement onto the current alerts. Its readers (cve_issues, cve_notify, nvd_monitor) go through is_resolved_by_vex.
  • Not traced: the path that closed the customer's issue with "VEX status fixed".

    • On both pipeline call sites, the VEX close runs only over still-reported alerts, and those have their scan statement withdrawn first.
    • So I could not reproduce from code alone how a scan-made fixed got there. Finding out would need the data, which I did not read.
    • After this change no new such statement is written, and the VEX close path ignores stored ones (is_resolved_by_vex). The test a_cve_gone_from_the_scan_is_never_closed_as_vex_fixed covers a present alert that still carries one.
  • Docs. The VEX guide (DE and EN) and the SBOM guide now describe the new behaviour.

Owner decisions (2026-11-27)

  • Tracker issues of a gone CVE stay open. Before, an open issue was closed with "the dependency was updated or removed", a cause the scan does not know. Now it stays open and gets one comment (DE/EN): the scan no longer finds the CVE, that alone does not prove a fix, and a person checks and closes it, in Prüfwerk with the VEX status "Behoben" and a reason.
    • TrackerIssue::gone_noted_at keeps it to one comment while the CVE stays gone. Finding the CVE again clears it, so a later disappearance is told again.
    • A closed issue whose CVE comes back is still reopened.
    • The managed-git and issues guides now say the same.
  • The 1 tracker issue already closed with "VEX status fixed" is left as it is. Prüfwerk does not reopen it; the owner or support decides.
  • Yocto "Patched" still states fixed. It carries the recipe's reason.
  • The "no longer found" marker in the dashboard is a separate UI item. It needs a mockup first.
  • Running scripts/vex-994-cleanup.js on stage or prod is the owner's command. It is a dry run by default and prints counts only.

Checks

  • cargo fmt --check passes, and clippy passes with the CI flags for core, agent, dashboard (server and web) and MCP.
  • Core: unit and schema tests pass. The new export test covers Weg A and Weg B: never fixed in OpenVEX, CycloneDX or CSAF.
  • Agent: after the rebase, 1120 unit tests and the vex_lifecycle integration tests pass against Mongo. cve_issues was rerun with a database, because CI skips its DB tests. That includes the reworked vex_lifecycle and a new tracker test: a gone CVE is never closed with a VEX status.
  • Tests pass for MCP (39), dashboard server (193) and dashboard web (169).
  • The cleanup script, tested on local Mongo with seeded data:
    • it removes only the inferred statement and keeps resolved_at
    • the Yocto and person statements and other databases are untouched
    • it refuses to run without a prefix

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Owner decisions on #994, 2026-11-27: take it up now, with the safe defaults below. Rebased onto main (v0.4.17). A complete scan that no longer finds a CVE no longer turns it into a VEX `fixed`, and no reader treats a missing CVE as fixed. Both routes from #994 are closed. ## What changes - **Weg A, setting the status.** `resolve_gone` only sets `resolved_at`, as the scan's observation. It writes no VEX statement. Each alert keeps the statement it has, and one without stays without. - **Weg B, reading the export.** `vex_docs::status_of` maps "no statement" to `under_investigation`, whether or not the CVE is gone. - **One rule in core: `CveAlert::statement()`.** It ignores the `fixed` that scans inferred before this change. Such a statement is identified as `by_scan`, `fixed` and with no `impact_statement`. A Yocto recipe's statement always gives its reason, so it still counts. - Everything reads through this rule: `status_of`, `is_resolved_by_vex` (notifications and tracker issues), the OpenVEX, CycloneDX and CSAF exports, the CVE groups and the ENISA drafts. - **CVE groups.** `cve_groups::is_open` now checks `resolved_at` itself, since "gone" and "fixed" are now different things. - **ENISA.** - `fixed_at`, and with it the final-report deadline, comes only from a `fixed` stated by a person. A gone CVE leaves field v22 and the deadline open. - An exploited CVE that is gone but was never seen exploited gets a new `Reportability::NoLongerFound` with an honest reason. Before, it got "Fixed". - **Dashboard and MCP.** `GET /targets/{id}/cves` and MCP `list_cves` drop the inferred statements (`CveAlert::drop_inferred_fix`), so the dashboard stops showing them. The dashboard's status comes from core `status_of`. - **Data.** `scripts/vex-994-cleanup.js` (mongosh) counts the stored inferred statements. It removes them (`$unset vex`) only with `apply = true`. It prints counts only and keeps `resolved_at`. - Whether and when the script runs against stage or production is the owner's call. I have only run it against local Mongo. ## Inventory (full grep over core, agent, dashboard and MCP) - **Writers of a VEX statement:** - the person (`handlers/vex.rs`, `by_scan: false`) - Yocto (`yocto_inventory::scan_statement`, used by `yocto_inventory` and `yocto_build`, always with an `impact_statement`) - and, before this change, `resolve_gone` So "`by_scan` + `fixed` + no `impact_statement`" matches only what `resolve_gone` wrote. - **Readers that bypass `statement()`:** - `cve_matrix` (handler), `inbox` and `platform` filter `resolved_at: null`. - The re-report path (`upsert_reported`) withdraws a scan's statement, so a still-reported alert never carries an inferred one. - `attach_stored_vex` copies the stored statement onto the current alerts. Its readers (`cve_issues`, `cve_notify`, `nvd_monitor`) go through `is_resolved_by_vex`. - **Not traced: the path that closed the customer's issue with "VEX status `fixed`".** - On both pipeline call sites, the VEX close runs only over still-reported alerts, and those have their scan statement withdrawn first. - So I could not reproduce from code alone how a scan-made `fixed` got there. Finding out would need the data, which I did not read. - After this change no new such statement is written, and the VEX close path ignores stored ones (`is_resolved_by_vex`). The test `a_cve_gone_from_the_scan_is_never_closed_as_vex_fixed` covers a present alert that still carries one. - **Docs.** The VEX guide (DE and EN) and the SBOM guide now describe the new behaviour. ## Owner decisions (2026-11-27) - **Tracker issues of a gone CVE stay open.** Before, an open issue was closed with "the dependency was updated or removed", a cause the scan does not know. Now it stays open and gets one comment (DE/EN): the scan no longer finds the CVE, that alone does not prove a fix, and a person checks and closes it, in Prüfwerk with the VEX status "Behoben" and a reason. - `TrackerIssue::gone_noted_at` keeps it to one comment while the CVE stays gone. Finding the CVE again clears it, so a later disappearance is told again. - A closed issue whose CVE comes back is still reopened. - The managed-git and issues guides now say the same. - **The 1 tracker issue already closed with "VEX status `fixed`" is left as it is.** Prüfwerk does not reopen it; the owner or support decides. - **Yocto "Patched" still states `fixed`.** It carries the recipe's reason. - **The "no longer found" marker in the dashboard is a separate UI item.** It needs a mockup first. - **Running `scripts/vex-994-cleanup.js` on stage or prod is the owner's command.** It is a dry run by default and prints counts only. ## Checks - `cargo fmt --check` passes, and clippy passes with the CI flags for core, agent, dashboard (server and web) and MCP. - Core: unit and schema tests pass. The new export test covers Weg A and Weg B: never `fixed` in OpenVEX, CycloneDX or CSAF. - Agent: after the rebase, 1120 unit tests and the `vex_lifecycle` integration tests pass against Mongo. `cve_issues` was rerun with a database, because CI skips its DB tests. That includes the reworked `vex_lifecycle` and a new tracker test: a gone CVE is never closed with a VEX status. - Tests pass for MCP (39), dashboard server (193) and dashboard web (169). - The cleanup script, tested on local Mongo with seeded data: - it removes only the inferred statement and keeps `resolved_at` - the Yocto and person statements and other databases are untouched - it refuses to run without a prefix 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang force-pushed fix/vex-not-from-scan from 5367c386b2 to fb28d0742b 2026-11-27 19:28:04 +00:00 Compare
sharang marked the pull request as ready for review 2026-11-27 19:28:18 +00:00
sharang added 2 commits 2026-11-27 22:00:12 +00:00
A complete scan that no longer finds a CVE used to state VEX `fixed`
(Weg A), and the exports read `resolved_at` without a statement as
`fixed` (Weg B). A CVE can disappear without a fix, so neither holds.

- resolve_gone only sets resolved_at; it states nothing.
- CveAlert::statement() ignores the `fixed` scans inferred that way
  (by_scan, fixed, no reason given); a Yocto recipe's statement gives its
  reason and still counts. status_of, is_resolved_by_vex, the exports,
  the CVE groups and the ENISA drafts all read through it.
- status_of: no statement means under_investigation, gone or not.
- ENISA: the final report is dated only by a person's `fixed`; an
  exploited CVE that is merely gone reads "no longer found", not fixed.
- The CVE list (API and MCP) leaves the inferred statements out, so the
  dashboard no longer shows them.
- scripts/vex-994-cleanup.js counts the stored ones and removes them only
  with apply=true; dry run by default, counts only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
fix(vex): an issue whose CVE is gone stays open, told so once (#994)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 5m27s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 22m15s
fbc1139626
A complete scan that no longer finds a CVE closed its tracker issue. A CVE
can disappear without a fix, so the issue now stays open and gets one
comment saying the scan no longer finds it and that a person checks and
closes it (in Prüfwerk with the VEX status "Behoben" and a reason).
TrackerIssue::gone_noted_at keeps it to one comment while the CVE stays
gone; when the CVE is found again it is cleared, so a later disappearance
is told again.

Docs (managed git, issues) say the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang force-pushed fix/vex-not-from-scan from fb28d0742b to fbc1139626 2026-11-27 22:00:12 +00:00 Compare
sharang merged commit 87b1e281ed into main 2026-11-27 22:23:04 +00:00
Sign in to join this conversation.