dsh-plugin-codegraph-project
github.com/troytse/dsh-plugin-codegraph-project
v0.1.4
会话与记忆
可执行外部程序以 shell 执行命令写入文件
Project-scoped CodeGraph for DeepSeek Harness: launches codegraph's MCP server through npx, shares one instance per project root across sessions, selects the global codegraph version, and injects its tools only into workspaces that actually have an index
该插件尚未翻译,显示作者原文。
dshdeepseek-harnesscordisplugincodegraphmcpcode-intelligence
检测报告
关注度高。命中了不少能力模式,其中可能有需要留意的。逐条看下面的清单。
2高关注2需留意4一般16未命中
高关注需留意一般
能力清单
- 可执行外部程序
spawns-processes高关注2 处命中scripts/real-codegraph-e2e.mjs:24import { execFileSync } from 'node:child_process'scripts/stdio-probe.mjs:3import { spawn } from 'node:child_process'- 看它调用哪些程序。调用本机已有的工具是常见做法。
- 以 shell 执行命令
shell-exec高关注2 处命中scripts/real-codegraph-e2e.mjs:50const out = execFileSync('npx', ['-y', `@colbymchenry/codegraph@${version}`, ...argsForCli], {scripts/real-codegraph-e2e.mjs:61const out = execFileSync('ps', ['-A', '-o', 'command'], { encoding: 'utf8' })- 看命令字符串是拼出来的还是写死的。拼接用户输入才是真正的风险。
- 写入文件
writes-files需留意6 处命中lib/index.js:135mkdirSync(dir, { recursive: true })scripts/real-codegraph-e2e.mjs:93mkdirSync(indexedProject, { recursive: true })scripts/real-codegraph-e2e.mjs:94mkdirSync(plainProject, { recursive: true })scripts/real-codegraph-e2e.mjs:95writeFileSync(join(indexedProject, 'math.ts'), 'export function beta(x: number) { return x * 2 }\nexport function alpha(…- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 可终止进程
kills-processes需留意2 处命中scripts/real-codegraph-e2e.mjs:211process.kill(pid, 0)scripts/stdio-probe.mjs:98try { process.kill(-child.pid, 'SIGKILL') } catch {}- 看它终止的是自己启动的进程,还是按名字匹配到的任意进程。
- 读取环境变量
reads-env一般11 处命中lib/index.js:648const home = process.env.DSH_HOME !== undefined && process.env.DSH_HOME !== ''lib/index.js:649? process.env.DSH_HOMElib/index.js:650: `${process.env.HOME ?? process.env.USERPROFILE ?? '.'}/.dsh`lib/locate.js:72export function protectedHomes(env = process.env) {- 环境变量里常混有密钥。看它是否把整个 env 都读走。
- 读取文件
reads-files一般6 处命中lib/locate.js:151entries = readdirSync(indexPath)lib/locate.js:170if (existsSync(join(current, '.git'))) {scripts/check-node-compat.mjs:25const MIN_NODE_MAJOR = Number(/(\d+)/.exec(JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).engines?.node ??…scripts/check-node-compat.mjs:43for (const name of readdirSync(root)) {- 读文件是绝大多数插件的正常工作方式,本身不构成顾虑。
- 接触凭据或密钥
credentials一般3 处命中README.md:229| A private registry needs credentials | The harness scrubs credentials out of child environments. Use a cache directory…README.md:273credentials has published it once. `npm whoami` must answer with the account's name; a token- 看它读取哪些凭据、发往哪里。用于登录自己的服务是正常的。
- 动态加载模块
dynamic-import一般1 处命中lib/index.js:59* @param {import('@deepseek-ai/cordis').Context} ctx - Plugin context.lib/index.js:226* @param {import('./locate.js').IndexLocation | undefined} locationlib/index.js:611const { resolveNpx } = await import('./pool.js')- 动态导入本身无害,但会让依赖关系难以静态审阅。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 可执行外部程序 | spawns-processes | 高关注 | 2 |
| 以 shell 执行命令 | shell-exec | 高关注 | 2 |
| 写入文件 | writes-files | 需留意 | 6 |
| 可终止进程 | kills-processes | 需留意 | 2 |
| 读取环境变量 | reads-env | 一般 | 11 |
| 读取文件 | reads-files | 一般 | 6 |
| 接触凭据或密钥 | credentials | 一般 | 3 |
| 动态加载模块 | dynamic-import | 一般 | 1 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 15 个文件,扫描于 2026-10-15。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。
依赖安全公告
这个插件声明的依赖中,有 4 条已公开的安全公告 (最高等级:中):
| 等级 | 依赖包 | 编号 | 摘要 |
|---|---|---|---|
| 中 | @modelcontextprotocol/sdk | CVE-2026-25536 | @modelcontextprotocol/sdk has cross-client data leak via shared server/transport instance reuse 修复版本:1.26.0 详情 → |
| 中 | @modelcontextprotocol/sdk | CVE-2026-104850 | MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server 修复版本:1.31.0, 2.2.0 详情 → |
| 未分级 | @modelcontextprotocol/sdk | CVE-2026-0621 | Anthropic's MCP TypeScript SDK has a ReDoS vulnerability 修复版本:1.25.2 详情 → |
| 未分级 | @modelcontextprotocol/sdk | CVE-2025-66414 | Model Context Protocol (MCP) TypeScript SDK does not enable DNS rebinding protection by default 修复版本:1.24.0 详情 → |
查询的是依赖声明范围的下界(如 ^4.2.0 查 4.2.0),
不是实际安装到的版本。真正装的时候如果解析到了修复版本,就不受影响——
所以这是「可能受影响」,不是「这个插件有漏洞」。数据来自
OSV.dev。