\!WARNING\! this removes the authentication step !WARNING! Exchanges the process launch token for the browser-session cookie, so a first visit needs no ?token=... in the URL.
Install
# from npm (prebuilt)
dsh plugin --profile web add @beyondandsharp/dsh-plugin-notoken
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:BeyondandSharp/dsh-plugin-notoken
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DSH 本地插件:注册一个登录入口路由(默认 GET /__dsh_login),把进程里的登录 token 换成浏览器会话
cookie,让首次访问不用带 ?token=…。
⚠️ 不安全
装上之后,任何能访问这个端口、并且 Host 通过 DSH 信任围栏的人,都等于拿到了 operator 权限 ——
可以执行工具、读取凭据、以运行 dsh web 的 OS 用户身份操作这台机器。
原理
DSH 只在两处做浏览器认证:frontend-static 渲染 index 前调用 connection.authorizeIndex(),以及
/api 路由自己的准入检查。插件注册的具名路由在两者之前匹配、默认不认证 —— 入口就在这条缝里:
GET /__dsh_login
├─ connection.requestRejection() 先过信任围栏:403 拒绝;401(还没有会话)放行
├─ connection.authenticatedUrl() 取当前进程 token(每次请求都取,重启后仍有效)
├─ connection.authorizeIndex() 进程内完成 token → cookie 交换(303 + Set-Cookie)
└─ 普通导航:
已带会话:303 转发给浏览器,地址栏落到 ./
没有会话:
· 标签 cross-site(Chrome 装应用启动,需 allowCrossSiteNavigation 放行)
或 none(Firefox 主屏、地址栏/书签等浏览器发起的导航)
→ 直接返回应用外壳,cookie 一起下发,不再重定向
· 标签 same-origin / same-site → 仍 303(这类链会带上 Strict cookie,不会循环)
直连入口的 none 导航地址栏停在入口路径;经 nginx 内部改写的部署地址栏仍是 /
外壳由本进程拨自己监听的真实绑定地址(webServer.host:port)取回,
不是 127.0.0.1:`dsh web --host <地址>` 只监听那一个接口,回环可能 ECONNREFUSED。
浏览器启动链上 SameSite=Strict 的 cookie 会被一直扣住,走 303 会变成"重定向次数过多";
所以入口对"没有会话、且标签为 cross-site(放行时)或 none 的文档导航"直接在同一次响应里
返回外壳;已认证的导航、以及 same-origin/same-site 的导航仍然走 303,地址栏落到干净的 ./。
外壳回源必须拨 listen 的真实绑定地址(webServer.getOrigin() 只用于启动公告):Firefox 的
Sec-Fetch-Site 与 cookie 判定是两套逻辑,标签为 none 时同样可能带不上 cookie。
mode: redirect 在 exchange 之前 302 到带 token 的 URL,那条链上主屏启动仍可能被扣住而
循环 —— 它是兼容回退,不覆盖主屏启动;完全不发 Sec-Fetch-* 的老客户端仍走 303。
不签 cookie、不接触密钥、不解析启动输出、不改 DSH 源码。
安装
$DSH plugin --profile web add @beyondandsharp/dsh-plugin-notoken # 从 npm
# 也可以直接装 GitHub 或本地目录:
$DSH plugin --profile web add github:BeyondandSharp/dsh-plugin-notoken
$DSH plugin --profile web add /path/to/dsh-plugin-notoken # DSH=/path/to/dsh
nginx
示例见 examples/nginx.conf:把裸 / 的 401 在服务端内部改写成入口,
地址栏全程停在 /。两条硬规则:Host 原样透传(cookie 绑定它),且该 authority 在 trustedHosts 里;
只拦 location = /,/api 与 WebSocket 一律原样透传。
验证
node --test && bash verify/e2e.sh
Links
More in this category
kenryu42/cc-safety-net★ 2123
Pre-execution guard that blocks destructive Git and filesystem commands and access to secrets such as SSH keys and .env files before a tool call runs.
ADWMC/helm-d#helmd★ 1589
Security-analysis plugin for DeepSeek Harness: 33 tools spanning six security domains, evidence/reporting and toolbox, plus the case lifecycle, routing and tool ledger; a session-bound case workflow with an evidence chain, E-id validation and reproducible findings; 362 on-demand references; three hot-swappable persona profiles; and a four-tab workbench (armor / case / intercept / about) with case-state recovery after context compaction.
SeaOf0/dsh-redteam-model★ 934
Authorized-security DSH collection: nine work modes (redteam coordinator, pentest, code audit, binary analysis, attack-defense, AV evasion, incident response, cloud security, CTF solving) and fifteen runtime plugins, managed from a settings page with one-click deploy, install, update and uninstall.
toby-bridges/api-relay-audit★ 934
Runs local security audits of AI API relays and LLM proxies from DeepSeek Harness, producing Markdown reports for prompt injection, model substitution signals, tool-call rewriting, error leakage, stream integrity, and profile-gated Web3 risks.
howmp/dsh-pentest★ 624
Authorized pentest mode for DeepSeek Harness — exploration chain, assets and findings with a Web view.
Jueze-2019/dsh-redteam-mode#packages/redteam-bundle★ 316
Red-team engagement mode: send one target organization name; a planner session runs five execution roles (recon, asset triage, vulnerability discovery, exploitation, internal pivot) with configurable concurrency; preflight checks skills/resources; scoring uses four stages (recon, internet, boundary, internal) with server-side caps and privilege-wins dedup; findings stay in a local SQLite fact base. The persistent right-side console has nine pages and includes asset mapping, agents, sessions/tunnels, findings, score targets, reports, POC knowledge base and skill library. v0.15.2 adds automatic HTTP evidence/action records, batch ingest, scope check, tunnel pivot probe, data proof, cleanup ledger and T0-T3 asset admission to prevent scope drift. 59 redteam_* tools; 38 bundled skills.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.