dsh-dep-audit: Dependency Tree Poisoning and Supply Chain Risk Checker

Introduction

In Node projects, npm install pulls the entire dependency tree, and many packages execute scripts during the install / postinstall phases. If version constraints are too broad, or dependencies point to git / http instead of a registry, you might execute third-party scripts at installation time even if you never import a specific package in your application code. Publicly reported npm supply chain incidents (such as event-stream, ua-parser-js, node-ipc, colors/faker, etc.) are often related to these vectors.

Manually reviewing every package.json and lockfile is costly and impractical for repetitive tasks every time dependencies change. dsh-dep-audit (npm package @deepwhale-cn/dsh-dep-audit) targets the manifest and lock information in the current directory, flagging risks such as install scripts, overly broad versions, and non-registry sources according to rules. It serves as a quick verification step before installation or within CI. It is an admin-security plugin within the DSH (DeepSeek Harness) ecosystem, maintained by feely0208. The community directory is available at the skillhub plugin page, and the source code is on GitHub.

What is this

In one sentence: Check the dependency tree for poisoning and risk vectors—scripts executed upon installation, overly broad versions, and non-registry sources.

The plugin is used via the CLI dsh-dep-audit or by integrating with DSH. It relies on @deepwhale-cn/dsh-guard-core and requires Node >= 18 and DSH >= 0.1.0-rc.6 (see package.json). The current release version is 0.1.1, licensed under MIT.

It does not replace a full SCA platform: the README explicitly states it does not query CVE databases and does not perform package name similarity (typosquat) detection (due to high false positive rates). Its positioning is a lightweight audit of supply chain “behavior and source,” and it can be composed with other plugins for licensing, SBOM, and CI protection (see the “Supply Chain and Build” entry in the README for related series).

Core Functions: What it checks

The official README categorizes detection items by level as follows (refer to the documentation for specific definitions):

Level Content
High Dependencies with install / postinstall scripts
Medium No lockfile; versions using * / latest; git / http sources
Low >=x.y.z without an upper bound

High level items correspond to the “execute upon installation” vector: scripts run during the npm install lifecycle regardless of whether they are referenced in application code.

Medium level items correspond to reproducibility and uncontrolled sources: without a lockfile, resolution results are prone to drift; * / latest increase the probability of poisoned versions entering the tree; git / http dependencies outside the npm registry lack the same auditing habits applied to registry tarballs.

Low level items correspond to missing semver upper bounds, which may lead to silent upgrades to unexpected minor or patch versions in the long term.

regarding report formats, in addition to terminal output, it supports HTML export (see usage below). The README provides screenshot links for reports, demo mode, and rule descriptions (plugin resource path on deepwhale.org.cn).

Boundaries and Manual Confirmation

The README emphasizes: Having install scripts does not equate to malware. Common native or download-based dependencies like esbuild, sharp, and puppeteer require install steps, and the plugin includes a whitelist. Items flagged still require manual judgment to determine acceptability.

Users must comply with local laws and regulations; the README states that users assume full responsibility for any consequences resulting from the use of this project.

Installation and Activation

The following two paths are from the original README; do not confuse them with the dsh plugin add github:owner/repo format.

  1. As a DSH plugin (example profile is web):
dsh plugin --profile web add @deepwhale-cn/dsh-dep-audit
  1. Without installing DSH, CLI only:
npx @deepwhale-cn/dsh-dep-audit

Before installing a DSH plugin, it is recommended to treat it like any third-party plugin: Review the source code and LICENSE, and confirm that it will run with the permissions of the current dsh process user. This permission level allows it to read and write to accessible workspaces and dependency directories to execute scanning logic.

Typical Usage

Run the following in the root directory of the project to be checked (containing package.json, and a lockfile if applicable):

dsh-dep-audit

This scans the current directory and lists rule hits in the terminal.

To preview what rule looks like and the output format, you can use demo mode:

dsh-dep-audit --demo

To archive results or share with colleagues who don’t use the CLI, you can generate an HTML report:

dsh-dep-audit --html r.html

Simply replace r.html with your desired path. Specific fields and styling depend on the current version’s CLI output.

Use Cases and Notes

Who is it for

  • Developers maintaining Node / frontend monorepos, looking for a supply chain hygiene check before merging dependency changes or releasing.
  • CI pipelines looking to add a lightweight gate (used alongside lockfile policies and private registries) to intercept install scripts and non-registry sources before passing to vulnerability scanning tools.
  • Teams already using DSH for engineering / Agent workflows, combining @deepwhale-cn/dsh-dep-audit with the series’ license-guard, ci-guard, and sbom plugins as suggested in the README.

Notes

  • When install / postinstall scripts are detected, open the corresponding package’s package.json scripts and check the published tarball behavior. Judge based on the whitelist and business necessity; do not simply delete packages based solely on alerts.
  • If CVE databases, full license texts, or SBOMs are required, use dedicated tools or other DSH plugins; do not expect this plugin to cover full SCA.
  • Running via pure npx will fetch the specified version of @deepwhale-cn/dsh-dep-audit from npm. As with any npx tool, please use it under a trusted network and a locked version strategy.

Conclusion

dsh-dep-audit consolidates signals related to poisoning and common supply chain attack vectors in the dependency tree—installation scripts, overly broad versions, non-registry sources, and missing lockfiles—into a single command-line check with optional HTML reports. It cannot replace human judgment regarding suspicious scripts, nor does it check for CVEs or typosquatting, but it significantly shortens the investigation path specifically regarding the “execute upon installation” phase.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye