dsh-db-tool
github.com/mengqi1436/dsh-db-tool
v1.8.0
界面与主题
以 shell 执行命令可执行外部程序写入文件
DSH community plugin: chat-operated multi-database admin tool with sidebar management, project-scoped grants, ro/rw modes and dangerous-operation confirmation
该插件尚未翻译,显示作者原文。
检测报告
关注度高。命中了不少能力模式,其中可能有需要留意的。逐条看下面的清单。
2高关注4需留意5一般13未命中
高关注需留意一般
能力清单
- 以 shell 执行命令
shell-exec高关注4 处命中dist/store/transfer-history.js:24const out = childProcess.execFileSync('powershell', ['-NoProfile', '-Command', "[Console]::OutputEncoding=[System.Text.E…scripts/hotfix-core.mjs:209const out = execFileSync(isWin ? 'where.exe' : 'which', ['dsh'], {scripts/hotfix-core.mjs:269execFileSync(scripts/hotfix-core.mjs:287execFileSync(- 看命令字符串是拼出来的还是写死的。拼接用户输入才是真正的风险。
- 可执行外部程序
spawns-processes高关注3 处命中dist/script/runner.js:11import { fork } from 'node:child_process';dist/store/transfer-history.js:10import * as childProcess from 'node:child_process';scripts/hotfix-core.mjs:19import { execFileSync, spawnSync } from 'node:child_process';- 看它调用哪些程序。调用本机已有的工具是常见做法。
- 写入文件
writes-files需留意23 处命中dist/store/audit.js:16fs.appendFileSync(this.file, JSON.stringify(full) + '\n', 'utf8');dist/adapters/mongodb/index.js:343await db.collection(from).rename(cmd.to);dist/store/index.js:37fs.mkdirSync(this.dir, { recursive: true });dist/store/io.js:25fs.mkdirSync(dir, { recursive: true });- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 发起网络请求
network需留意1 处命中client/client.js:483const response = await fetch(API + "/" + path, init);- 看请求发往哪些域名。发往作者自己的后端是常见做法。
- 动态执行代码
dynamic-code需留意1 处命中dist/script/worker.cjs:5* - 脚本运行在 worker 进程的 vm.runInNewContext 新 realm 中,仅注入 db/console;dist/script/worker.cjs:77sandbox = vm.createContext({ db, console: consoleBridge });- 看 eval / new Function 的入参来自哪里。常量字符串和用户输入是两回事。
- 启动伪终端
spawns-pty需留意1 处命中dist/store/transfer-history.js:24const out = childProcess.execFileSync('powershell', ['-NoProfile', '-Command', "[Console]::OutputEncoding=[System.Text.E…- 伪终端等于给了一个完整 shell。确认这是插件的核心功能。
- 接触凭据或密钥
credentials一般219 处命中client/client.js:106urlPassword: "密码(可选,自动注入 URL;留空保持已存)",client/client.js:110fieldsPassword: "密码",client/client.js:111passwordSaved: "已保存(留空保持不变)",client/client.js:322url: "Connection URL (password moved to secrets automatically)",- 看它读取哪些凭据、发往哪里。用于登录自己的服务是正常的。
- 动态加载模块
dynamic-import一般33 处命中dist/adapters/index.js:2mysql: () => import('./mysql/index.js').then((m) => m.createMysqlAdapter),dist/adapters/index.js:3postgresql: () => import('./postgresql/index.js').then((m) => m.createPostgresqlAdapter),dist/adapters/index.js:4gaussdb: () => import('./gaussdb/index.js').then((m) => m.createGaussdbAdapter),dist/adapters/index.js:5sqlite: () => import('./sqlite/index.js').then((m) => m.createSqliteAdapter),- 动态导入本身无害,但会让依赖关系难以静态审阅。
- 读取文件
reads-files一般29 处命中dist/store/audit.js:24if (!fs.existsSync(this.file))dist/store/audit.js:26const lines = fs.readFileSync(this.file, 'utf8').split('\n');dist/store/io.js:51if (!fs.existsSync(file))dist/store/io.js:54return JSON.parse(fs.readFileSync(file, 'utf8'));- 读文件是绝大多数插件的正常工作方式,本身不构成顾虑。
- 读取环境变量
reads-env一般13 处命中dist/adapters/sqlite/index.js:19const forced = process.env.DBT_SQLITE_DRIVER;dist/store/index.js:35const home = homeDir ?? (process.env['DSH_HOME'] || path.join(os.homedir(), '.dsh'));dist/store/index.js:44this.transferLog = new TransferLog(process.env.VITEST === 'true' ? this.dir : transferLogDir());dist/script/runner.js:26/** 最小化环境变量:--permission 只禁 fs,脚本仍可读 process.env,故 fork 时按白名单裁剪 */- 环境变量里常混有密钥。看它是否把整个 env 都读走。
- 使用 vm 模块做隔离
uses-vm-module一般1 处命中dist/script/worker.cjs:19const vm = require('node:vm');- 用 node:vm 是在建立隔离,不是在突破它。本身不是顾虑,但值得知道这个插件会执行动态代码。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 以 shell 执行命令 | shell-exec | 高关注 | 4 |
| 可执行外部程序 | spawns-processes | 高关注 | 3 |
| 写入文件 | writes-files | 需留意 | 23 |
| 发起网络请求 | network | 需留意 | 1 |
| 动态执行代码 | dynamic-code | 需留意 | 1 |
| 启动伪终端 | spawns-pty | 需留意 | 1 |
| 接触凭据或密钥 | credentials | 一般 | 219 |
| 动态加载模块 | dynamic-import | 一般 | 33 |
| 读取文件 | reads-files | 一般 | 29 |
| 读取环境变量 | reads-env | 一般 | 13 |
| 使用 vm 模块做隔离 | uses-vm-module | 一般 | 1 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 52 个文件,扫描于 2026-10-15。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。
依赖安全公告
已查询这个插件声明的全部依赖,没有匹配到已公开的安全公告。(含 DSH 框架包在内的 @deepseek-ai/* 不作查询——那是运行时自己的问题,不是插件的。)