COR-1646: distinct malicious verdict at install time (npm/pip)#126
Open
juangaitanv wants to merge 5 commits into
Open
COR-1646: distinct malicious verdict at install time (npm/pip)#126juangaitanv wants to merge 5 commits into
juangaitanv wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Finding: src/verify_deps/registry.rs:535 — CI rust-tests is currently red. Evidence: the GitHub job failed with -D clippy::question-mark on lines 535-540 (this block may be rewritten with the ? operator) and exited 101, while the PR body says clippy passed. Impact: this branch cannot be merged/released with required checks failing, independent of the install-verdict behavior. Fix: apply the clippy suggestion at that block (use let r = suffix.strip_prefix('c')?; for the final fallback) or otherwise make ./harness ci pass on the PR branch.
Sent by Cursor Automation: pr-flow
New VerdictStatus::Malicious and BlockReason::Malware for install-time malware detection. - Malicious classifier: malware flag OR MAL- prefix match - Malicious counts in vulnerability aggregation - JSON schema adds "malicious" field (schema_version unchanged) - Tests + MAL- → CVE fixture sweep
Drop the MAL- prefix fallback from VulnMatch::is_malicious(). Live /check reports the GHSA canonical alias as advisory_id (worker.js: canonical_alias || advisory_id), not the MAL- id, so the prefix never fired for GHSA-aliased malware — the server malware flag is the single reliable signal. The vuln-api /check malware field is therefore required, and the worker must deploy with/ before the CLI (a pre-COR-1646 server has no flag -> malicious packages still block as Vulnerable, fail-safe, just unlabelled). Update the classifier tests to the real contract: a malicious /check match carries a GHSA advisory_id + malware:true; a MAL- id without the flag now stays Vulnerable.
juangaitanv
force-pushed
the
juan/cor-1646
branch
from
July 14, 2026 12:03
0076abe to
66e9fdb
Compare
PR #126 review (render.rs:334): the shared Vulnerable|Malicious tree render arm printed the `fix with:` upgrade hint, and verdict_json emitted a `remediation` version, for a pre-existing malicious dep. A mixed CVE+MAL payload could surface the CVE's advertised fix, steering toward installing another version of a malicious package instead of removing it. Suppress both for Malicious verdicts. Tests: render unit test (malicious verdict_json remediation is null) and a mixed CVE+MAL bare-install tree E2E (no `fix with:`, JSON remediation null).
leenk7991
reviewed
Jul 15, 2026
leenk7991
reviewed
Jul 15, 2026
leenk7991
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


COR-1646: Distinct malicious verdict at install time (npm/pip)
Known-malicious packages already blocked at install time, but were folded into the generic vulnerable verdict. This surfaces them as a distinct, blocking malicious signal on the
corgea npm/corgea pipwrappers (yarn/pnpm/uv inherit via the shared precheck path).What changed
VerdictStatus::Malicious(src/precheck/mod.rs), separate fromVulnerable, carrying all matches.VulnMatch::is_malicious()=malwareflag ORadvisory_idstarts withMAL-(src/vuln_api/mod.rs). TheMAL-prefix keeps the label correct even if this CLI ships before the worker that sets the authoritative flag.BlockReason::Malwarewith top precedence and a distinct refusal (src/precheck/verdict.rs,render.rs):Refusing to run install: known MALICIOUS package(s) detected. Pass --force only if you are certain.known malicious:headline in both named and tree arms; separatemaliciouscounts in the text summary (omitted when zero).--json: new"status": "malicious", per-match"malware"boolean, and amaliciouscount in each summary object.schema_versionstays 1 (purely additive).--forceoverrides the malicious block unchanged and propagates the package manager's exit code.--forcehelp (src/main.rs) andskills/corgea/SKILL.mdcopy; swept generic-vulnerable test fixtures offMAL-ids toCVE-so they stayVulnerableunder the new prefix rule.Testing
cargo build --release✓cargo test✓ — all suites green (0 failed); +9 new tests: distinct malicious block + exit,--forceoverride, mixed CVE+MAL tally, malicious-in-tree path, and a guard that a merely-vulnerable run's output never contains the string "malicious".cargo clippy --all-targets -- -D warnings✓,cargo fmt --check✓Acceptance (COR-1646)
Maliciousverdict, separate fromVulnerable, with its own messagecorgea npm/corgea pipblock a known-malicious version with a distinct message + non-zero exit--forceoverridesDepends on the vuln-api change (Corgea/vuln-api, COR-1646) that emits the authoritative
malwareflag from/check; theMAL-prefix fallback means this CLI is correct regardless of deploy order.Linear: COR-1646 · Parent: COR-1632 (POL-01)