Skip to content

deps: match dependencies against the bundled IOC database, not just the (empty) feed - #317

Open
Ar9av wants to merge 1 commit into
mainfrom
fix/deps-ioc-feed
Open

deps: match dependencies against the bundled IOC database, not just the (empty) feed#317
Ar9av wants to merge 1 commit into
mainfrom
fix/deps-ioc-feed

Conversation

@Ar9av

@Ar9av Ar9av commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

prismor deps — whose entire job is "check workspace dependencies against the threat feed" — never matched anything, because the shipped signed feed (advisories/immunity-feed.json) contains 217 advisories but 0 of type dependency_vulnerability. Meanwhile Prismor curates a rich IOC database in supplychain/ioc.py (the TanStack / mini-Shai-Hulud / AntV supply-chain attacks). The two were never connected.

So a manifest pinning a known-malicious package Prismor itself documents was reported clean:

Beforerequirements.txt with mistralai==2.4.6 + guardrails-ai==0.10.1 (both curated IOCs), package.json with @mistralai/mistralai@2.2.4 → only a missing-lockfile nag:

deps before

After — the same manifests, all three flagged CRITICAL with attack attribution:

deps after

Fix

scan_workspace() now also consults the bundled supplychain.ioc via a new check_against_ioc(), independent of the signed feed (no signing key needed, always present). Matches are shaped exactly like feed matches, so all rendering, JSON output, and the exit-code=1 behavior are unchanged; deduped by (advisory_id, dep name).

An exact pip pin (==2.4.6) is normalized to its concrete version so it hits the CRITICAL exact-range verdict instead of degrading to a name-only HIGH. Floating specifiers (>=, ~=, ^) still fall back to name-only.

Testing

  • 0 → 3 CRITICAL findings on the repro manifests.
  • Negative control: the legitimate adjacent release mistralai==2.4.5 stays clean (no false positive).
  • 3 regression tests added to tests/test_deps_semver.py (empty-feed IOC match; no-FP on safe version; npm range). Full file: 11 passed.

Screenshots are real captures on the throwaway pr-assets/cloak-fix branch (not part of this diff).

…he feed

`prismor deps` correlated manifests only against the signed advisory feed's
`dependency_vulnerability` entries — of which the shipped feed
(advisories/immunity-feed.json) has ZERO (217 advisories, 0 dependency ones).
So a manifest pinning a known-malicious package Prismor itself curates in
supplychain/ioc.py — mistralai==2.4.6, guardrails-ai==0.10.1,
@mistralai/mistralai in the mini-Shai-Hulud range — was reported clean (only a
missing-lockfile nag). The dependency checker's core job silently did nothing.

Fix: scan_workspace now also consults the bundled supplychain.ioc database via
a new check_against_ioc(), independent of the signed feed (no signing needed,
always present). Results are shaped like feed matches so all rendering and
exit-code logic is unchanged; deduped by (id, name) against feed matches.

An exact pip pin ("==2.4.6") is normalized to its concrete version so it hits
the CRITICAL exact-range verdict rather than degrading to a name-only HIGH;
floating specifiers (>=, ~=, ^) still fall back to the name-only verdict.

On the repro manifests: 0 -> 3 CRITICAL findings. Safe adjacent version
(mistralai==2.4.5) stays clean. 3 regression tests added to test_deps_semver.py
(empty-feed IOC match, no-false-positive on safe version, npm range).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant