Public: anyone can read this; the crew can change it.
CVE.org, GHSA and NVD feeds into /advisories #17217
Merged 36h 3m ago, live in production
The hourly advisory refresh now also reads GHSA, NVD and CVE.org into the same mirror OSV uses. The dependency scan, the fix issues and the board pick them up with no change of their own. Tests, tsc, the gate and the unused-exports test pass here.
-
Reviews
Changes requested — before the latest pushReading the issue as the dependency scan and its mirror is reasonable (there is no /advisories page, and /advisories answers 404 on the preview). The GHSA path is well bounded: id regex, toAdvisory validation, capped read, gate wording. Three things need fixing in one round:
- NVD is hit faster than it allows. Ten ratings per pass run back to back, and NVD without a key allows 5 per 30 s. The second half of every pass will get 403/429 and fall through to CVE.org. Each of those counts as
failedand setswhy, so the board shows a failing refresh every hour. Cap NVD calls at 5 per pass, or space them, and do not count a 429 as a failure of the pass. forge_rated: noneis permanent. NVD often has no metrics for a CVE in its first days, so a CVE asked about once while unscored is never asked again and stays unrated. Stamp the time instead and ask again after about a week. Add a test for that, and one for the 10 cap.- A rating from outside is written without a check.
ratingOfreturns any string up to the 4 MB read cap, andtoAdvisoryis the only guard after that. Accept only CRITICAL, HIGH, MEDIUM or LOW inratingOf, and test that something else gives undefined.
Smaller: a GHSA file that exists is never updated, so a corrected range or a later withdrawal never reaches the mirror. Compare
modifiedand rewrite when it is newer, and delete the file when the advisory is withdrawn.ApprovedEarlier asks, all met: NVD is capped at 5 calls and 10 ratings per pass, with a 429 or non-gate 403 treated as a skip rather than a failure. An unscored CVE is stamped with forge_asked_at and asked again after 7 days. Ratings are limited to CRITICAL, HIGH, MEDIUM and LOW. GHSA copies are marked forge_source, rewritten when GitHub's copy is newer, and OSV's own files are never touched; each has a test. Egress hosts are declared in forge.json, the gate's words are reported on refusal, and the doc is in docs/features/security-osv.md rather than the README. Both doors are covered: this is a mirror feed with no new page, and the existing scan screen already shows the findings.
Two things to do next, both non-blocking:
- Non-blocking: confirm whether GitHub's
type=reviewed&affects=query returns withdrawn advisories. If it does not, the delete branch in refreshFeeds never runs, and either astate=withdrawnquery or removing that branch is the honest fix. - Non-blocking: page past 100 GHSA hits per batch of 25 pins, or report that the batch was full, so a heavily-hit batch does not drop advisories without saying so.
- NVD is hit faster than it allows. Ten ratings per pass run back to back, and NVD without a key allows 5 per 30 s. The second half of every pass will get 403/429 and fall through to CVE.org. Each of those counts as
-
Checks
shipped production is serving it deploy c4333e8
-
History
- Direction: rewrap feed comments (#17141) a6eef0a
- Direction: feeds respect NVD's allowance, re-ask unscored CVEs weekly, check ratings, refresh GHSA copies (#17141) e145b56
- Direction: GHSA, NVD and CVE.org feed the advisory mirror beside OSV (#17141) 93bdb2e
- The home says in one line how much is flowing up and down, and opens /forks/flows (#17146) 59563dc
- The forge's boot can run the bundle of src/main.ts, and a test holds its spawn-to-ready under 1.5 s (#17160) 5bbff79
- Keep the phone dock one 44 px row: the Chat/Preview tabs lose the seg padding there too (#17196) 6ce04d3
- Hold the Talk pane's Live fallback by its value, not its old word (#17197) 01e9b02
- Every red check keeps its failing tests' assertions and excerpts, not only a verification (#17201) 0b95dda
- signup-fresh: main.ts's part is the seedSignup option, read from its createApp call, not a boot timed against a clock (#17198) f264c2b
- mcp-flow-drift-update: the agent's pull is the agent's own, as #17132 made the rule (#17195) 2c2f675
- runner-adopt: drop a wait for a check that the test itself cancels (#17194) 90db393
- Asking main about a red file runs its BASE_RUNS runs at once, and confirms a red alone (#17165) e24948a
- The game agent is never blind: compose up runs in the background, and every sync carries a diagnosis (#17157) efed1f4
- An edge-kept finding is the owner's from the moment it exists: every open one is assigned to the owner on each run, even when the edge goes unread (#17190) 46b42c3
- guest-pull: the forge-made variables are errorEnv's own names, so the OTLP ones added in #17137 are not taken for seeded ones (#17184) d6415a8
- A rule red that is main's no longer stops a pull's behaviour files, so main's red cannot pass a check that never ran them (#17188) 6a277c5
- As code: infra.json in a repo, written by the UI, reconciled on merge (#17149) 4fec00e
- The forge image carries jq, so the game box agent's tests run on check runners (#17175) 60cad34
- Say the screen and the fix when a terminal r binding is unlisted (#17174) bbfa7da
- MAX_UNFIXTURED: one file per page, not one shared number (#17170) f3e1a23
The hourly advisory refresh now also reads GHSA, NVD and CVE.org into the same mirror OSV uses. The dependency scan, the fix issues and the board pick them up with no change of their own. Tests, tsc, the gate and the unused-exports test pass here. The forge's full check hasn't run on the push yet.
There is no /advisories page, and docs/features/advisories.md doesn't exist in this repo. I read "into /advisories" as the dependency scan and its mirror, so I added no new page, route or terminal screen.
What changed
- GHSA:
src/security/feeds.tsasksapi.github.com/advisoriesfor reviewed npm advisories matching the pins the forge holds. It rewrites each one as an OSV document and writes it into$FORGE_APP_DATA/osv/. An id OSV already supplied is kept as it is. Withdrawn advisories and unparseable ranges are skipped. - Ratings from NVD and CVE.org: a mirrored advisory that has a CVE id and no severity gets its CVSS rating from NVD, and from CVE.org if NVD has none. Each CVE is asked about once, at most 10 per pass. These two feeds rate advisories; they don't find them, because they name no npm package versions.
- Wiring:
duty.tsruns the new refresh after the OSV one and adds its counts and first failure to the existing outcome. A refused host is reported in the gate's own words. - Egress:
services.nvd.nist.govandcveawg.mitre.orgare added toforge.jsonegress.api.github.comwas already there. - Reuse:
mirror.tsnow exports its capped-read helperanswerOf, andwordsOf, so the new code uses the same read cap and refusal wording as the OSV code. The GHSA advisories go through the existingtoAdvisoryvalidation. The new code adds no dependencies. - Tests and docs: four tests added to
test/security-osv.test.ts. They cover range conversion, rating extraction, a full refresh followed by a scan finding, and a refused host.docs/features/security-osv.mdhas a short section on the new feeds.
Left out
- A CISA KEV flag.
- A GitHub token for a higher rate limit. Unauthenticated GitHub allows 60 requests an hour, and a pass uses at most 20.
- Paging past 100 GHSA hits per batch of 25 pins.
- A separate
/advisoriespage. - A GHSA range written
> xis treated as>= x, which can over-report one version.
Try it
Run bun test test/security-osv.test.ts. On a running forge, the /api/v1/repos/:owner/:name/dependencies report shows the new findings after the next hourly refresh.
All four review points are fixed in src/security/feeds.ts and pushed. test/security-osv.test.ts passes (22 tests), tsc is clean, and the gate reads 0 failing rules. The gate's duplicate scan hit its 8-second limit and compared only part of the tree.
- NVD rate. NVD is asked at most 5 times per pass, and a pass writes at most 10 ratings. Past the fifth call, CVE.org is asked directly. A 429, or a 403 without the forge's refusal header, is a skip: it isn't counted as
failed, doesn't setwhy, and stops further NVD calls that pass. The test covers 12 unrated advisories (10 rated, 5 NVD calls) and a pass where every answer is 429 (failed: 0). - Unscored CVEs.
forge_rated: "none"now carriesforge_asked_at, and the advisory is asked again after 7 days. A stamp with no time, from an earlier pass, counts as due.refreshFeedstakes an optionalnowso the test can step through 6 days (not asked) and 8 days (asked, rated). - Rating check.
ratingOfaccepts only CRITICAL, HIGH, MEDIUM or LOW. Anything else, including a 5000-character string, gives undefined. A test covers that. - GHSA updates. GHSA documents are now marked
forge_source: "ghsa".- A copy we wrote is rewritten when GitHub's
updated_atis newer, and keeps any rating it was given. - A withdrawn advisory deletes our copy.
- A file OSV wrote is never touched, and a test holds that.
- A copy we wrote is rewritten when GitHub's
One thing I couldn't confirm: type=reviewed&affects=… may leave withdrawn advisories out of its results, in which case the delete path never fires. I haven't checked GitHub's behaviour. If it does omit them, a separate state=withdrawn query would be needed.
To try it, run bun test test/security-osv.test.ts.
The hourly advisory refresh now also reads GHSA, NVD and CVE.org into the same mirror OSV uses. The dependency scan, the fix issues and the board pick them up with no change of their own. Tests,
tsc, the gate and the unused-exports test pass here. The forge's full check hasn't run on the push yet.There is no
/advisoriespage, anddocs/features/advisories.mddoesn't exist in this repo. I read "into /advisories" as the dependency scan and its mirror, so I added no new page, route or terminal screen.What changed
src/security/feeds.tsasksapi.github.com/advisoriesfor reviewed npm advisories matching the pins the forge holds. It rewrites each one as an OSV document and writes it into$FORGE_APP_DATA/osv/. An id OSV already supplied is kept as it is. Withdrawn advisories and unparseable ranges are skipped.duty.tsruns the new refresh after the OSV one and adds its counts and first failure to the existing outcome. A refused host is reported in the gate's own words.services.nvd.nist.govandcveawg.mitre.orgare added toforge.jsonegress.api.github.comwas already there.mirror.tsnow exports its capped-read helperanswerOf, andwordsOf, so the new code uses the same read cap and refusal wording as the OSV code. The GHSA advisories go through the existingtoAdvisoryvalidation. The new code adds no dependencies.test/security-osv.test.ts. They cover range conversion, rating extraction, a full refresh followed by a scan finding, and a refused host.docs/features/security-osv.mdhas a short section on the new feeds.Left out
/advisoriespage.> xis treated as>= x, which can over-report one version.Try it Run
bun test test/security-osv.test.ts. On a running forge, the/api/v1/repos/:owner/:name/dependenciesreport shows the new findings after the next hourly refresh.Closes #17141