CQ-02 exempts dependency findings by path, which the bundle author controls

Open
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
security, typescript
Domain
backend, security

Research direction

Read the CQ-02 dependency path exemption and SC-01 SBOM generation, then inspect cq01_secrets.py and the repo's e2e corpus. Work out how SBOM package identity can distinguish published dependencies from hand-made directories while keeping ordinary dependency findings informational. Done means both CQ-02 and the secret matcher handle vendored files consistently without reproducing the #135 mass mis-certification.

Written by the indexing model from the issue text.

Description

false-positive pkg/scanner

The gap

CQ-02 reports findings in vendored code as informational rather than blocking, decided by whether the path contains a directory like node_modules, deps or vendor. That path is chosen by the bundle author, so a payload placed in one exempts itself.

Reproduced against the real analyser — a benign entry point requiring a payload one directory away:

index.js            require("./vendor/index.js")
vendor/index.js     base64-eval, read ~/.ssh/id_rsa, POST it out

CQ-02: pass — every finding INFO, in_deps=True

Why it is not simply closed

Removing the exemption was tried and reverted in #135. Measured against the repo's own e2e corpus, it drops finnhub and folk from level 1 to level 0 on fifteen CRITICAL findings each, in typer, pyperclip and PyYAML. GuardDog's threat rules fire readily on ordinary libraries, so charging a bundle for its dependencies fails most of the fleet — the same mass mis-certification #135 exists to prevent.

Excluding the manifest's declared entry point does not help either: the payload need only be one require away from whatever the manifest names.

What would close it

Attribute vendored code against the SBOM that SC-01 already produces. A file under node_modules/<pkg>/ where <pkg> resolves to a real published package with a matching purl is genuinely third-party; a hand-made directory named vendor is not. That distinguishes the two cases on evidence rather than on a naming convention.

This also wants the exemption narrowed rather than removed — the goal is to stop trusting the path, not to start blocking PyYAML.

Related

cq01_secrets.py has the same shape pointed the other way: its "/deps/" in file_path check never matches GuardDog-style relative paths, so secrets found in vendored code are charged to the bundle. Fixing that matcher without the SBOM work would introduce this same bypass there, so the two belong together.

Dominant language
TypeScript
Stars
14
Forks
13
Avg merge
16m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NimbleBrainInc/mpak

All issues in NimbleBrainInc/mpak

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.