Skip to content

fix(guarddog): do not count GuardDog 3 capability inventory as malware indicators - #1135

Open
sandstream wants to merge 3 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-guarddog-sweep
Open

sandstream wants to merge 3 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-guarddog-sweep

Conversation

@sandstream

Copy link
Copy Markdown
Owner

What

The nightly Security — Full App Scan / Stage 1d — GuardDog malware sweep has failed on main every night since 2026-11-25 with 54 malware indicator(s) ... Coverage unverified. No kit-research note covers this; it was found from the failing nightly runs (45599204851, 45801662331, 45982866281; last success 45389346633).

Root cause (measured locally with the pinned guarddog 3.2.0 + semgrep 1.184.0)

  1. Scope grew. ce5551d runs GuardDog with GUARDDOG_NPM_INCLUDE_DEV_DEPENDENCIES=true, so the sweep went from 2 packages (smol-toml, zod) to 12 (dependencies plus devDependencies). That change was intended.
  2. Kit counted GuardDog's capability inventory as malware. GuardDog 3's per-package issues includes the capability-* rules, which list what code can do. Its risk engine (guarddog/analyzer/risk_engine.py) forms a risk only from a threat rule. Of the 54 hits, 50 were capability hits, for example capability-network-outbound on Promise.resolve( in zod and capability-process-spawn on exec( in @types/node declarations. This PR fixes that.
  3. Rule errors leave coverage partial, which is correct. metadata_mismatch cannot run on @types/node@22.20.5, because the tarball root is node v22.20/ and GuardDog 3.2.0 looks only in package/ and node/. The 24.x and 25.x tarballs use node/. This is a GuardDog limitation, so the gate still fails closed. This PR does not change that.

No finding is a real malware signal. The four threat-rule hits that remain are:

  • @modelcontextprotocol/sdk@1.32.2: three threat-runtime-environment-read hits on process.env.MCP_* in dist/cjs/examples/*;
  • prettier@3.10.1: one threat-runtime-obfuscation hit on a Unicode range table in index.mjs.

GuardDog's own risk score labels both packages low.

Change

  • src/guarddog.ts: the indicator count is now the number of threat and metadata rule findings; capability-* rules are skipped. If kit cannot read the per-rule results, it keeps GuardDog's issues count. A rule error or download error still sets a partial gap, so the scan stays unverified.
  • Test in src/guarddog.test.ts, a doc line in docs/INSPECTION_COMMANDS.md, and changes/guarddog-capability-inventory.md.

Before / after

Unit test on main (before the fix):

not ok 12 - counts threat and metadata findings, not GuardDog 3 capability inventory
  expected: 'pass'
  actual: 'fail'
# pass 11
# fail 1

After the fix (guarddog.test.js and check-security-guarddog.test.js): # pass 15, # fail 0.

checkGuardDog run locally on kit's own package.json with guarddog 3.2.0:

  • before: 54 malware indicator(s). Inspect with guarddog npm verify. Coverage unverified: GuardDog returned invalid package results or could not complete package rules
  • after: 4 malware indicator(s). Inspect with guarddog npm verify. Coverage unverified: GuardDog returned invalid package results or could not complete package rules

The nightly stays red after this PR, by design

The four low-severity threat hits and the @types/node metadata_mismatch gap still fail it. Making it green is an owner decision, and this PR does not take it. Options:

  • move @types/node to a version whose tarball root GuardDog can read, or report the issue to GuardDog upstream;
  • decide how to treat the four reviewed threat hits at these exact versions.

Unverified

  • macOS. The change is pure classification code with no filesystem or process work, and it was tested on Linux only.
  • The nightly cannot be run on demand. My local run could not resolve DNS, so the two email-domain metadata rules also errored here; in CI they probably run.
  • The 2026-11-24 success reported zod clean. Locally, guarddog 3.2.0 reports one capability hit on zod 4.6.7. I could not explain the difference.
  • Harnesses: this is a scanner classification change, not agent-harness wiring. Claude Code, Codex and the other harnesses kit supports are unaffected.

Generated by Claude Code

…e indicators

GuardDog 3 adds `capability-*` rules to its per-package `issues` total. They
list what code can do (spawn, network, file reads) and its own risk engine
forms a risk only from a threat rule. Since the nightly sweep started covering
devDependencies, kit's twelve direct dependencies reported 54 "indicators",
50 of them capability hits such as `Promise.resolve(` or `exec(` in type
declarations.

Count threat and metadata rule findings instead. A report whose per-rule
results kit cannot read keeps GuardDog's own count, and a rule error still
leaves coverage unverified, so an incomplete scan still fails closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kit review gate at d4bc449d5374: gates passed. All 33 checks passed on this commit, no file is in a protected class, 4 files and 89 lines changed. This approval is deterministic; it does not judge what the change is for.

@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream-kit-reviewer sandstream-kit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kit review gate at aa1936107549: not approved.

  • checks did not pass: windows shard 4/4, windows-native

This branch has not been deployed

No deployments
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.

2 participants