Public: anyone can read this; the crew can change it.

/advisories: the forge listens to CVE.org, OSV, GHSA, NVD, CISA KEV and EPSS, matches them to every repo's dependencies, and gives a sleek explorer with fix-pull actions, MCP tools and integrations #6017

Parked opened this in answer to
Closed without merging

This is a first slice of #6005, not the whole issue. /advisories now works for ingested OSV and CISA KEV data and shows which repos are hit. The forge doesn't listen to any feed yet, and most of the rest of the issue's list is still to do.

Notes

stopped parked by the crew deploy d46897c

opened this

This is a first slice of #6005, not the whole issue. /advisories now works for ingested OSV and CISA KEV data and shows which repos are hit. The forge doesn't listen to any feed yet, and most of the rest of the issue's list is still to do.

tsc is clean, the new tests pass, and forge-looks, mcp-size and reserved-names pass. In the wider run of related test files, two capture tests in test/looks.test.ts fail because the sandbox can't run chromium. I did not run the full suite or check. The run also showed openapi-coverage: 29 NOT_YET_DESCRIBED entries could be removed; I did not look into it.

What changed

  • src/core/advisories.ts parses OSV JSON, one record or an array, into one row per package range. It rejects malformed input, caps a batch at 500 records, and validates ids and versions.
  • The CISA KEV list marks which CVEs are exploited in the wild. The advisory and advisory_kev tables are an additive migration.
  • src/core/exposure.ts reads each repo's package-lock.json at its default branch. Parsing is cached per blob id, and the same module matches the packages against the advisories.
  • /advisories is for forge admins who are people; anyone else gets a 404. The top line answers "am I exposed today?". Cards show the KEV badge, severity, ecosystem and package, fixed version, and "affects N of your repos". There is a search box, and exploited advisories sort first.
  • An admin pastes OSV or KEV JSON into a form on the page to ingest it (POST /advisories, same-origin checked). Output is escaped.
  • MCP: audit takes an advisories: "<text>" argument that returns the same data. tools/list is at its size ceiling, so I extended audit instead of adding a tool, as docs/MCP.md says to do. I added a short note to docs/MCP.md.
  • forge.json lists /advisories in app.looks; advisories is a reserved name.
  • Tests: test/advisories.test.ts and test/advisories-page.test.ts. They cover version comparison, parsing, KEV ordering, lockfile exposure, escaping, the 404 for non-admins and the cross-origin 403.

Left out

  • Live listening to CVE.org, OSV, GHSA, NVD, KEV and EPSS. Ingest is paste-in for now; a poller would call parseOsv and saveKev.
  • EPSS and CVSS numeric scoring; severity is whatever OSV supplies.
  • Lockfiles other than npm's package-lock.json. Dependency paths and SBOM export are not built.
  • The fix-pull, accept-risk, mute and not-reachable actions.
  • Paging the owner, streaming the feed, filters beyond text search, and trends.
  • Push, email and webhook notifications, the RSS/Atom feed, and the scratchpad board view.

Try it: sign in as an admin and open /advisories. Paste an OSV record with the feed set to "OSV record(s)", then the KEV JSON. Or call the MCP audit tool with advisories: "lodash". No dependencies were added.

Closes #6005

4 earlier comments
commented

This is a first slice of #6005, not the whole issue. /advisories now works for ingested OSV and CISA KEV data and shows which repos are hit. The forge doesn't listen to any feed yet, and most of the rest of the issue's list is still to do.

tsc is clean, the new tests pass, and forge-looks, mcp-size and reserved-names pass. In the wider run of related test files, two capture tests in test/looks.test.ts fail because the sandbox can't run chromium. I did not run the full suite or check. The run also showed openapi-coverage: 29 NOT_YET_DESCRIBED entries could be removed; I did not look into it.

What changed

  • src/core/advisories.ts parses OSV JSON, one record or an array, into one row per package range. It rejects malformed input, caps a batch at 500 records, and validates ids and versions.
  • The CISA KEV list marks which CVEs are exploited in the wild. The advisory and advisory_kev tables are an additive migration.
  • src/core/exposure.ts reads each repo's package-lock.json at its default branch. Parsing is cached per blob id, and the same module matches the packages against the advisories.
  • /advisories is for forge admins who are people; anyone else gets a 404. The top line answers "am I exposed today?". Cards show the KEV badge, severity, ecosystem and package, fixed version, and "affects N of your repos". There is a search box, and exploited advisories sort first.
  • An admin pastes OSV or KEV JSON into a form on the page to ingest it (POST /advisories, same-origin checked). Output is escaped.
  • MCP: audit takes an advisories: "<text>" argument that returns the same data. tools/list is at its size ceiling, so I extended audit instead of adding a tool, as docs/MCP.md says to do. I added a short note to docs/MCP.md.
  • forge.json lists /advisories in app.looks; advisories is a reserved name.
  • Tests: test/advisories.test.ts and test/advisories-page.test.ts. They cover version comparison, parsing, KEV ordering, lockfile exposure, escaping, the 404 for non-admins and the cross-origin 403.

Left out

  • Live listening to CVE.org, OSV, GHSA, NVD, KEV and EPSS. Ingest is paste-in for now; a poller would call parseOsv and saveKev.
  • EPSS and CVSS numeric scoring; severity is whatever OSV supplies.
  • Lockfiles other than npm's package-lock.json. Dependency paths and SBOM export are not built.
  • The fix-pull, accept-risk, mute and not-reachable actions.
  • Paging the owner, streaming the feed, filters beyond text search, and trends.
  • Push, email and webhook notifications, the RSS/Atom feed, and the scratchpad board view.

Try it: sign in as an admin and open /advisories. Paste an OSV record with the feed set to "OSV record(s)", then the KEV JSON. Or call the MCP audit tool with advisories: "lodash". No dependencies were added.

commented

This comment needs no code change, so I pushed nothing new. It's an automatic triage note. It says #6005 has no pillar and waits behind the Later gate until someone names one. Naming a pillar is a planning decision for a person to make on the issue, so I haven't tried to set one.

The branch scout/6005-advisories-the-forge-listens-to-cve-org still holds the first slice from the previous push:

  • OSV and CISA KEV ingest
  • per-repo lockfile exposure
  • the admin /advisories page
  • the audit tool's advisories argument

The live feed listeners, fix-pull actions, notifications, RSS feed and board view are still unbuilt. They could be split into child issues once a pillar is chosen.

commented

I merged main into the branch and pushed it. The only conflict was src/http/mcp.ts. I ran the advisories tests, the mcp-size test and the type check, and they pass. The full bun test did not finish in this sandbox, so the forge's check will be its first full run.

  • Conflict: main split mcp.ts into one file per tool under src/http/mcp/tools/. I took main's version of mcp.ts and moved this pull's audit change into src/http/mcp/tools/audit.ts. That change is the advisories argument, still limited to an admin who is a person, and it still answers with advisoryView.
  • Size ceiling: on the merged tree the mcp-size test failed, because main was already close to the tools/list argument-description budget. I gave advisories no description and dropped audit's duplicate repo description, which REPO_ARG already supplies. docs/MCP.md still documents the argument.
commented

I merged main into this branch and pushed. The only conflict was in docs/MCP.md.

  • Conflict: both sides had edited the end of the MCP docs. I kept main's line saying the CLI forge command covers "tell, status, decide, plan, preview, pulls", and kept the Advisories section after it.
  • Checks: a targeted run passed, 45 tests across 11 files. It covered the advisories, advisories page, audit and first eight mcp-* suites.
  • Not done: I didn't get a result from a full bun test plus type check; it ran past 15 minutes in the background. The forge's own check on this push will run all of it.
commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs