把本地 Host 的 HTTP 请求头上限提高到 128 KiB,并且只在真正签发新 dsh-auth cookie 的令牌交换响应里清理旧 Cookie;已经卡在 431 的桌面 profile 能恢复,之后随机端口启动只保留一条。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:zhkkjF/dsh-cookie-sentinel
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A Host bundle for DeepSeek Harness Desktop that fixes the random-port
dsh-auth-* cookie lockout (HTTP 431 → desktop welcome: Web authentication failed).
The failure
DSH Desktop starts its Host Web server on a fresh random loopback port each
launch. @deepseek-ai/dsh-client-connection names its browser-session cookie
after the request authority, which includes that port:
dsh-auth-<sha256("127.0.0.1:<port>")>
Cookies are stored per host and ignore the port, and the minted cookie lives
for 30 days, so every launch leaves another dsh-auth-… cookie on 127.0.0.1
while none of the earlier ones expire. Around 70 entries the accumulated
Cookie request header crosses Node's 16 KiB HTTP header limit; the Host
answers 431 Request Header Fields Too Large before routing, and Electron's
welcome transport reports:
desktop welcome: Web authentication failed
What this plugin does
Two things in apply(ctx):
- Headroom. Raises the live
http.Serverheader limit to128 KiB(configurable, 16 KiB – 1 MiB). Node readsserver.maxHeaderSizefor every new connection, so the one request that still carries the already-broken jar reaches the authentication route instead of dying in the parser. ThewebServerservice is provided before its class plugin finishes[Service.init], so the bundle retries for up to 10 s if the server object does not exist yet. - Mint-driven pruning. Wraps
connection.authorizeIndex, and only when that response mints a newdsh-auth-…cookie (the launch-token exchange) it appendsSet-Cookie: …; Max-Age=0deletions for every otherdsh-auth-…name the request carried. The Electron session stores those deletions, so the jar shrinks back to the current launch's cookie. A response that mints nothing (401, or the later 200) is left untouched — a future DSH version that changes the cookie spelling cannot make this plugin delete the valid cookie.
apply never throws: the Desktop shell treats a failed startup entry as fatal,
and a guard that can prevent a broken start must never become the reason the
app cannot start.
Install
From the plugin market, or directly:
dsh plugin --profile <profile> add github:zhkkjF/dsh-cookie-sentinel
The package is host-only; no build step and no runtime dependencies beyond Node built-ins.
Config
- insert:
- id: dsh-cookie-sentinel
name: dsh-cookie-sentinel
config:
maxHeaderSize: 131072 # 16 KiB – 1 MiB, default 128 KiB
Audit log
One line per launch is appended to ~/.dsh/cookie-sentinel.log:
2026-11-03T12:15:22.306Z loaded
2026-11-03T12:15:22.307Z ready headerLimit=131072
2026-11-03T12:15:22.315Z pruned=1 host=127.0.0.1:63104
pruned=N is the number of stale dsh-auth-… cookies deleted in the
launch-token response. After a clean first launch, later launches should report
N=1; a growing N means the Electron session is not storing the deletions
and a different repair is needed.
Verification performed
- A 70-cookie request (17,638 bytes) returns
401, not431. - 500 cookies (125,998 bytes) still return
401; 600 cookies (151,198 bytes) return431, matching the configured 128 KiB boundary. - With a synthetic
authorizeIndexthat mints a cookie, 70 stale cookies produce 71Set-Cookieheaders (1 mint + 70 deletions) and the minted name is preserved; a no-mint response produces no deletions. - The header limit is applied when the server object appears 120 ms after the consumer plugin runs (the retry path).
The Electron cookie jar itself is owned by Chromium and cannot be read while the app is running; the audit log is the supported way to observe real pruning.
License
MIT
链接
同类插件
kenryu42/cc-safety-net★ 1900
执行前守卫,在工具调用运行前拦截破坏性 Git 与文件系统命令,以及对 SSH 密钥、.env 等机密文件的访问。
ADWMC/helm-d#helmd★ 984
DeepSeek Harness 的安全分析插件:33 个工具覆盖六大安全域、证据/报告与工具集,并提供案件生命周期、路由和工具账本;按会话绑定的案件工作区支持证据链、E 编号校验与可复现结论(repro_cmd);内置 362 篇按需参考、三档可热切换人设,以及带案件状态恢复的破甲 / Case / 拦截 / 关于四页工作台。
toby-bridges/api-relay-audit★ 904
从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。
SeaOf0/dsh-redteam-model★ 807
面向授权安全研究的 DSH 合集:九个工作模式(redteam 总控、渗透测试、代码审计、二进制分析、攻防评估、免杀对抗、应急溯源、云安全攻防、CTF 解题)与十五个运行时插件,设置页管理台支持一键部署、安装、更新与卸载。
howmp/dsh-pentest★ 616
面向 DeepSeek Harness 的授权渗透模式:以探索链路记录目标、线索、资产与漏洞,并在 Web 中可视化展示。
PerryLink/dsh-auto-review★ 244
审批链上的第二模型自动审查:只读审查子代理返回带理由的 allow/deny 结构化裁决,默认 fail-closed。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。