weavatrix 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,8 +26,11 @@ function visibleSignals(signals, allow) {
26
26
  return hasStrongerUrl ? kept.filter((s) => s.key !== "hardcoded-url") : kept;
27
27
  }
28
28
 
29
- function escalatedSeverity(baseSeverity, smoking, multi, nearZeroFp) {
30
- if (smoking && nearZeroFp) return "critical";
29
+ // Heuristic source matches can justify urgent review, but they cannot prove that code executed or
30
+ // credentials left the machine. Reserve `critical` for independently confirmed advisories/runtime
31
+ // evidence; this scanner therefore has an explicit HIGH ceiling.
32
+ function heuristicSeverity(baseSeverity, smoking, multi) {
33
+ if (baseSeverity === "critical") return "high";
31
34
  if ((smoking || multi) && (baseSeverity === "medium" || baseSeverity === "low")) return "high";
32
35
  return baseSeverity;
33
36
  }
@@ -63,20 +66,34 @@ export function buildMalwareFindings({ byPkg, importedPkgs, contentRoots, scanMo
63
66
  for (const key of keys) {
64
67
  const ofKey = visible.filter((s) => s.key === key);
65
68
  const base = ofKey[0];
66
- const severity = escalatedSeverity(base.severity, smoking, multi, base.nearZeroFp);
69
+ const severity = heuristicSeverity(base.severity, smoking, multi);
67
70
  findings.push(makeFinding({
68
71
  category: "malware",
69
72
  rule: key,
70
73
  severity,
71
74
  confidence: base.nearZeroFp ? "high" : multi ? "medium" : "low",
75
+ assessment: "SUSPICIOUS_STATIC_EVIDENCE",
76
+ confirmedExecution: false,
77
+ requiresRuntimeConfirmation: true,
78
+ severityCeiling: "high",
72
79
  title: `${base.what}: ${pkg}`,
73
- detail: `${base.what} in installed package "${pkg}"${multi ? ` - co-occurs with ${[...keys].filter((k) => k !== key).join(", ")} (escalated)` : ""}${importedPkgs.has(pkg) ? ". This package IS imported by the repo's own code." : ". Transitive install (still runs its install scripts)."} Heuristic pattern match - inspect the cited file before acting.`,
80
+ detail: `${base.what} in installed package "${pkg}"${multi ? ` - co-occurs with ${[...keys].filter((k) => k !== key).join(", ")} (escalated)` : ""}${importedPkgs.has(pkg) ? ". This package IS imported by the repo's own code." : ". Transitive install (its install scripts may have run)."} Static heuristic evidence only: execution, package compromise, and credential exposure are NOT confirmed. Inspect the cited file and verify origin/lockfile/runtime evidence before acting.`,
74
81
  package: pkg,
75
82
  file: base.file ? String(base.file).replace(/\\/g, "/") : "",
76
83
  line: base.line || 0,
77
84
  evidence: evidenceRows(ofKey),
78
85
  source: "heuristic",
79
- fixHint: smoking ? `treat as compromised: remove ${pkg}, reinstall from a clean lockfile, rotate reachable secrets` : `review the cited code in ${pkg}`,
86
+ verification: {
87
+ staticPattern: "MATCHED",
88
+ runtimeExecution: "NOT_VERIFIED",
89
+ packageOrigin: "NOT_VERIFIED",
90
+ lockfileIntegrity: "NOT_VERIFIED",
91
+ credentialExposure: "NOT_VERIFIED",
92
+ decision: "MANUAL_CONFIRMATION_REQUIRED",
93
+ },
94
+ fixHint: smoking
95
+ ? `quarantine and inspect ${pkg}; verify package origin and lockfile integrity before removal; rotate secrets only if execution or credential exposure is confirmed`
96
+ : `review the cited code in ${pkg}`,
80
97
  }));
81
98
  }
82
99
  }