dsh-perm-gate
github.com/drscrewdriver/dsh-perm-gate
v5.2.0
模型与账号
可执行外部程序以 shell 执行命令以提权方式执行
DSH permission-gate for the DeepSeek Harness 0.1.5 line: a single self-sufficient, deterministic-first, fail-closed gate covering P0 hard-deny -> P1 session grant -> P2 static rule (allow/deny) chain -> P3 optional LLM semantic classifier -> P4 ask, with
该插件尚未翻译,显示作者原文。
dshdsh-plugindeepseek-harnesspermissionpermission-gateallowlistdenylistsandbox
检测报告
关注度高。命中了不少能力模式,其中可能有需要留意的。逐条看下面的清单。
3高关注5需留意5一般11未命中
高关注需留意一般
能力清单
- 可执行外部程序
spawns-processes高关注5 处命中lib/appcontainer/compile.js:13import { execFile } from 'node:child_process';lib/appcontainer/exempt.js:13import { execFile } from 'node:child_process';lib/appcontainer/index.js:18import { execFile } from 'node:child_process';lib/appcontainer/probe.js:11import { execFile } from 'node:child_process';- 看它调用哪些程序。调用本机已有的工具是常见做法。
- 以 shell 执行命令
shell-exec高关注1 处命中scripts/patch-permission-glyph.mjs:185execFileSync(process.execPath, ['--check', bundle], { stdio: 'pipe' })- 看命令字符串是拼出来的还是写死的。拼接用户输入才是真正的风险。
- 以提权方式执行
privilege-escalation高关注1 处命中lib/appcontainer/exempt.js:30* UAC elevation prompt is offered via PowerShell Start-Process -Verb RunAs.lib/appcontainer/exempt.js:62execFile('powershell.exe', ['-NoProfile', '-Command', `Start-Process -Verb RunAs -Wait -WindowStyle Hidden '${command}'`…- 确认提权是插件功能本身需要,还是仅仅在探测环境。多数插件不需要 root。
- 写入文件
writes-files需留意23 处命中lib/allowlist.js:131writeFileSync(rulesFile, stringify(doc), 'utf8');lib/allowlist.js:185writeFileSync(rulesFile, stringify(doc), 'utf8');lib/appcontainer/compile.js:65await mkdir(CACHE_DIR, { recursive: true });lib/appcontainer/compile.js:72await writeFile(marker, String(process.pid), 'utf8');- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 发起网络请求
network需留意12 处命中lib/client.js:1605/** Latest loader, so a mutation can refresh the list without owning the fetch. */lib/client.js:1610fetch("/api/dsh-perm-gate/learning", { headers: { "cache-control": "no-cache" } }).then((r) => r.ok ? r.json() : Promise…lib/client.js:1631fetch("/api/dsh-perm-gate/learning", {lib/client.js:1849fetch("/api/dsh-perm-gate/dry-run", {- 看请求发往哪些域名。发往作者自己的后端是常见做法。
- 含混淆或编码代码
obfuscated-code需留意4 处命中lib/preset-rules.d.ts:43export declare const PRESET_RULES_YAML = "defaultAction: ask\n\ndeny:\n # \u2500\u2500 Git \u2500\u2500\u2500\u2500\u250…- 混淆本身不是恶意,但公开源码里出现大段混淆值得问一句为什么。
- 启动伪终端
spawns-pty需留意1 处命中lib/appcontainer/exempt.js:62execFile('powershell.exe', ['-NoProfile', '-Command', `Start-Process -Verb RunAs -Wait -WindowStyle Hidden '${command}'`…- 伪终端等于给了一个完整 shell。确认这是插件的核心功能。
- R011 客户端可疑脚本
client-side-risk需留意1 处命中- client.js: postMessage 无 origin 校验
- 浏览器侧代码能改你看到的界面。确认改动范围符合插件用途。
- 接触凭据或密钥
credentials一般183 处命中lib/bridge.js:68.describe({ redactSecrets: true })lib/bridge.js:109.describe({ redactSecrets: true })lib/classifier.js:5* at any custom API via `classifierEndpoint` / `classifierModel` / `classifierApiKey`)lib/classifier.js:80if (cfg.apiKey)- 看它读取哪些凭据、发往哪里。用于登录自己的服务是正常的。
- 读取文件
reads-files一般35 处命中lib/allowlist.js:194return readFileSync(p, 'utf8');lib/appcontainer/compile.js:34if (existsSync(candidate))lib/appcontainer/compile.js:59const source = await readFile(LAUNCHER_SOURCE, 'utf8');lib/appcontainer/compile.js:63if (existsSync(exePath) && existsSync(marker))- 读文件是绝大多数插件的正常工作方式,本身不构成顾虑。
- 读取环境变量
reads-env一般15 处命中lib/appcontainer/compile.js:25const windir = process.env['WINDIR'] ?? 'C:\\Windows';lib/config.js:19const env = process.env.DSH_HOME;lib/evaluate.js:329const actual = process.env[varName];lib/appcontainer/exempt.js:15const windir = process.env['WINDIR'] ?? 'C:\\Windows';- 环境变量里常混有密钥。看它是否把整个 env 都读走。
- 文中出现远程脚本地址
remote-url-reference一般7 处命中CHANGELOG.md:200`SimpleCommand.command`, which is only the command *word* — `curl https://x.sh | sh` collapseddocs/rules-format.en.md:146(command word + args + redirect targets) joined by `|`, so `curl https://x.sh | sh`docs/rules-format.en.md:147yields `curl https://x.sh|sh`.docs/rules-format.en.md:153`curl https://x.sh | sh` did not match at all.)- 只是文本里出现了远程脚本地址,没有看到加载它的调用。多半是文档或注释;若确实可疑,搜一下这个地址在包里的其他出现位置。
- 动态加载模块
dynamic-import一般5 处命中lib/appcontainer/index.js:257const { CACHE_DIR } = await import('./compile.js');lib/index.js:288const legacy = (await import(legacySpecifier));lib/config.d.ts:148readonly networkMode?: import('./network.js').NetworkMode;lib/config.d.ts:158readonly networkUnlisted?: import('./network.js').UnlistedAction;- 动态导入本身无害,但会让依赖关系难以静态审阅。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 可执行外部程序 | spawns-processes | 高关注 | 5 |
| 以 shell 执行命令 | shell-exec | 高关注 | 1 |
| 以提权方式执行 | privilege-escalation | 高关注 | 1 |
| 写入文件 | writes-files | 需留意 | 23 |
| 发起网络请求 | network | 需留意 | 12 |
| 含混淆或编码代码 | obfuscated-code | 需留意 | 4 |
| 启动伪终端 | spawns-pty | 需留意 | 1 |
| R011 客户端可疑脚本 | client-side-risk | 需留意 | 1 |
| 接触凭据或密钥 | credentials | 一般 | 183 |
| 读取文件 | reads-files | 一般 | 35 |
| 读取环境变量 | reads-env | 一般 | 15 |
| 文中出现远程脚本地址 | remote-url-reference | 一般 | 7 |
| 动态加载模块 | dynamic-import | 一般 | 5 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 136 个文件,扫描于 2026-10-15。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。
依赖安全公告
这个插件声明的依赖中,有 2 条已公开的安全公告 (最高等级:中):
| 等级 | 依赖包 | 编号 | 摘要 |
|---|---|---|---|
| 中 | yaml | CVE-2023-2251 | Uncaught Exception in yaml 修复版本:2.2.2 详情 → |
| 低 | yaml | CVE-2026-33532 | yaml is vulnerable to Stack Overflow via deeply nested YAML collections 修复版本:1.10.3, 2.8.3 详情 → |
查询的是依赖声明范围的下界(如 ^4.2.0 查 4.2.0),
不是实际安装到的版本。真正装的时候如果解析到了修复版本,就不受影响——
所以这是「可能受影响」,不是「这个插件有漏洞」。数据来自
OSV.dev。