Repository navigation
fix(guarddog): do not count GuardDog 3 capability inventory as malware indicators - #1135
Open
sandstream wants to merge 3 commits into
Open
sandstream wants to merge 3 commits into
sandstream wants to merge 3 commits into
Conversation
…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>
|
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>
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
This branch has not been deployed
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.
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)
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.issuesincludes thecapability-*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 examplecapability-network-outboundonPromise.resolve(in zod andcapability-process-spawnonexec(in@types/nodedeclarations. This PR fixes that.metadata_mismatchcannot run on@types/node@22.20.5, because the tarball root isnode v22.20/and GuardDog 3.2.0 looks only inpackage/andnode/. The 24.x and 25.x tarballs usenode/. 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: threethreat-runtime-environment-readhits onprocess.env.MCP_*indist/cjs/examples/*;prettier@3.10.1: onethreat-runtime-obfuscationhit on a Unicode range table inindex.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'sissuescount. A rule error or download error still sets a partial gap, so the scan stays unverified.src/guarddog.test.ts, a doc line indocs/INSPECTION_COMMANDS.md, andchanges/guarddog-capability-inventory.md.Before / after
Unit test on main (before the fix):
After the fix (
guarddog.test.jsandcheck-security-guarddog.test.js):# pass 15,# fail 0.checkGuardDogrun locally on kit's ownpackage.jsonwith guarddog 3.2.0:54 malware indicator(s). Inspect with guarddog npm verify. Coverage unverified: GuardDog returned invalid package results or could not complete package rules4 malware indicator(s). Inspect with guarddog npm verify. Coverage unverified: GuardDog returned invalid package results or could not complete package rulesThe nightly stays red after this PR, by design
The four low-severity threat hits and the
@types/nodemetadata_mismatchgap still fail it. Making it green is an owner decision, and this PR does not take it. Options:@types/nodeto a version whose tarball root GuardDog can read, or report the issue to GuardDog upstream;Unverified
Generated by Claude Code