dsh-plugin-mobile-gateway
github.com/SparkElf/dsh-plugin-mobile-gateway
DeepSeek Harness 的设备鉴权移动网关,支持会话与实时事件、排队消息同步及编辑/删除/Steer、Session 归档和重命名的双向同步、停止当前生成并稍后继续、任务列表和当前 Goal 同步及管理、服务端驱动的命令和技能菜单、Human-in-the-loop、图片及文件传输。安装后,Harness WebUI 左侧边栏会出现“移动设备”入口,可直接开启网关、生成配对二维码和管理可信设备。
作者原文(英文)
Mobile gateway for DSH 0.1.7 (Session format 4) with an entry-VPS Session cache. Reads DSH 0.1.7 Session format 4 and lifts retired v3 message shapes on read; a companion cache service plus gateway proxy let a phone fetch history from the entry host at 10
中文简介由 DeepSeek 模型翻译,仅供参考。
检测报告
能力清单
- 以 shell 执行命令
shell-exec高关注4 处命中bin/push-session-cache.mjs:76const raw = execFileSync('zstd', ['-dc', path], { maxBuffer: 512 * 1024 * 1024, encoding: 'utf8' })bin/session-cache-proxy.mjs:198const raw = execFileSync('zstd', ['-dc', path], { maxBuffer: 512 * 1024 * 1024, encoding: 'utf8' })bin/setup-ip.mjs:73return execFileSync(command, args, { stdio: 'inherit', ...options })bin/setup-ip.mjs:78execFileSync('sh', ['-c', `command -v "$1" >/dev/null 2>&1`, 'sh', command], { stdio: 'ignore' })- 看命令字符串是拼出来的还是写死的。拼接用户输入才是真正的风险。
- 可执行外部程序
spawns-processes高关注3 处命中bin/push-session-cache.mjs:18import { execFileSync } from 'node:child_process'bin/session-cache-proxy.mjs:23import { execFileSync } from 'node:child_process'bin/setup-ip.mjs:9import { execFileSync } from 'node:child_process'- 看它调用哪些程序。调用本机已有的工具是常见做法。
- 写入文件
writes-files需留意31 处命中lib/devices.js:53fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 })lib/devices.js:55fs.writeFileSync(tmp, JSON.stringify({ version: STORE_VERSION, devices }, null, 2), { mode: 0o600 })lib/devices.js:57fs.renameSync(tmp, file)lib/gateway-state.mjs:21fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 })- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 发起网络请求
network需留意3 处命中lib/client.js:70const response = await fetch(path, { credentials: 'same-origin', ...options })bin/protocol-harness.mjs:73const socket = net.connect(port, host)bin/setup-ip.mjs:207const request = http.get({- 看请求发往哪些域名。发往作者自己的后端是常见做法。
- 启动伪终端
spawns-pty需留意1 处命中bin/setup-ip.mjs:78execFileSync('sh', ['-c', `command -v "$1" >/dev/null 2>&1`, 'sh', command], { stdio: 'ignore' })- 伪终端等于给了一个完整 shell。确认这是插件的核心功能。
- 接触凭据或密钥
credentials一般50 处命中lib/client.js:70const response = await fetch(path, { credentials: 'same-origin', ...options })lib/devices.js:16function digest(secret) {lib/devices.js:17return crypto.createHash('sha256').update(secret, 'utf8').digest('hex')lib/devices.js:143// A valid one-time pairing code authorizes credential rotation. Keep- 看它读取哪些凭据、发往哪里。用于登录自己的服务是正常的。
- 读取文件
reads-files一般38 处命中lib/devices.js:62const parsed = JSON.parse(fs.readFileSync(file, 'utf8'))lib/gateway-state.mjs:19const read = () => validate(JSON.parse(fs.readFileSync(file, 'utf8')))lib/index.mjs:141return JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf8')).versionlib/index.mjs:706const dirents = await fsp.readdir(resolved.target, { withFileTypes: true })- 读文件是绝大多数插件的正常工作方式,本身不构成顾虑。
- 读取环境变量
reads-env一般15 处命中bin/push-session-cache.mjs:25let secret = process.env.DSH_CACHE_SECRET ?? ''bin/push-session-cache.mjs:26let home = process.env.DSH_HOME ?? '/root/.dsh'bin/push-session-cache.mjs:27let endpoint = process.env.DSH_CACHE_ENDPOINT ?? 'https://dsh.tokensfree.eu.cc/cache'bin/session-cache-proxy.mjs:29let port = Number(process.env.DSH_PROXY_PORT ?? 7091)- 环境变量里常混有密钥。看它是否把整个 env 都读走。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 以 shell 执行命令 | shell-exec | 高关注 | 4 |
| 可执行外部程序 | spawns-processes | 高关注 | 3 |
| 写入文件 | writes-files | 需留意 | 31 |
| 发起网络请求 | network | 需留意 | 3 |
| 启动伪终端 | spawns-pty | 需留意 | 1 |
| 接触凭据或密钥 | credentials | 一般 | 50 |
| 读取文件 | reads-files | 一般 | 38 |
| 读取环境变量 | reads-env | 一般 | 15 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 29 个文件,扫描于 2026-10-14。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。
依赖安全公告
这个插件声明的依赖中,有 2 条已公开的安全公告 (最高等级:中):
| 等级 | 依赖包 | 编号 | 摘要 |
|---|---|---|---|
| 中 | ws | CVE-2026-45736 | ws: Uninitialized memory disclosure 修复版本:8.20.1 详情 → |
| 中 | ws | CVE-2026-48779 | ws: Memory exhaustion DoS from tiny fragments and data chunks 修复版本:5.2.5, 6.2.4, 7.5.11 详情 → |
查询的是依赖声明范围的下界(如 ^4.2.0 查 4.2.0),
不是实际安装到的版本。真正装的时候如果解析到了修复版本,就不受影响——
所以这是「可能受影响」,不是「这个插件有漏洞」。数据来自
OSV.dev。