fix(registry): read every page of OSV results when checking for malicious packages #2036
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 363 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.353
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2036"
general
weight: 0.35
jdx
aube's malicious-package check asks OSV's
/v1/querybatchabout each package. When a package has a lot of advisories, OSV splits them across pages and returns anext_page_tokenwith the first page. aube read only that first page, so aMAL-advisory on a later page was never seen. The package installed even withadvisoryCheck = required.This affected both OSV checks: the name check
aube addruns before resolving, and the version-aware check of every newly resolved package after resolving.Before: OSV returns a first page of ordinary
GHSA-advisories plusnext_page_token, and theMAL-entry is on page 2. aube installs the package.After: aube sends a follow-up batch for only the queries that came back with a token, passing each token as
page_token(with the same name and version), and merges the pages until no tokens remain. TheMAL-advisory is found and the install is blocked, or a warning is shown, exactly as for a first-page hit.If OSV is still returning tokens after 16 pages, aube treats the check as failed rather than clean.
advisoryCheck = requiredthen stops the install, andadvisoryCheck = onwarns and continues, the same as for any other OSV error. A real package needs one or two pages.If a later page fails, any
MAL-advisory already read from earlier pages still blocks the install, even underadvisoryCheck = on. A package whose pages were not all read never counts as clean.Unpaginated results, which is nearly every package, still take one request per batch. The follow-up requests only happen for packages OSV actually paginates.
Validation: new unit tests feed the paging loop a three-page result and check that the
MAL-hit from page 3 is found. They also check that follow-up queries keep the version and token that a server that never stops paging fails the probe, and that a hit from page 1 survives a failed page 2. Clippy and thesupply_chaintests pass. There was no live OSV run, because this environment can't reach api.osv.dev.🤖 Generated with Claude Code
AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.
---
_Generated by Claude Code_
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Supply-chain advisory lookups now follow pagination across up to 16 pages, helping include advisories from later results.
Results with more pages remaining are no longer treated as clean. If a lookup cannot be completed, confirmed malicious results are still returned; an unfinished lookup with no confirmed hits returns an error.
Lookups that exceed the supported page limit return an error rather than continuing indefinitely.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->