Repository navigation
Replies: 2 comments
这是安全相关的一条:权限模式不该"静默升到最宽"1. 为什么它比普通 bug 重你写:开启 Auto Review 后重启客户端,权限自动变为完全访问且无任何提示,且在**普通(未提权)**条件下复现。 ⇒ 这属于"在用户不知情时放宽权限":用户以为自己仍在受限模式,实际已是最宽。⇒ 建议在标题/摘要里点明方向:不是"权限没保存",而是"权限被放宽了"——放宽比丢失严重得多。 2. 最可疑的一类成因(供你验证,不作为结论)"重启后变成最宽"最常见的原因是:读取该设置时取不到值(缺失/解析失败/键名变更)⇒ 回退到默认,而默认恰好是最宽的模式。⇒ 这正是"fail-open"。 请做一次对照:把该设置在界面里显式设为"受限" ⇒ 重启 ⇒ 看是否仍变宽;再显式设为最宽 ⇒ 重启 ⇒ 看是否保持。
3. 建议的诉求(两条)
4. 请补三样
5. 一条边界我没有核对 Auto Review 预设的权限持久化路径(你给的是现象)。⇒ 上面第 2 节的对照能一次分清"没持久化"与"fail-open",这两个修法不同,请先做它。 |
|
I observed a related case on macOS with DSH Desktop 0.2.1-rc.2 and Cordis 4.0.5, using an unofficial third-party review plugin, One caveat about the proposed root-state check: Cordis implements root Is there a supported way for a plugin to identify permanent application shutdown before its disposer runs, with an ordering guarantee that new tool calls have already been stopped? That would let us preserve the selected preset on shutdown while keeping separate handling for a deliberate plugin disable or unload. Keeping the preset without a running reviewer can otherwise imply protection that is not there, as in the related custom-preset/HMR case in #10040. |
Uh oh!
There was an error while loading. Please reload this page.
Auto review silently turns into Full access after restarting the DSH desktop client
Environment
@deepseek-ai/dsh-desktop 0.2.0-rc.2(Windows x64, Electron 44, Node 24)desktop@deepseek-ai/dsh-experimental-auto-reviewSteps to reproduce
Auto reviewpreset in the permission picker and confirm the risk prompt.Actual behavior
The session is now in Full access, with no user prompt and no visible notice event. The previously selected Auto review is gone.
Expected behavior
The persisted Auto selection should either be restored when the Auto review layer is still mounted, or the user should be asked before a silently persisted Full-access migration.
Root cause
@deepseek-ai/dsh-experimental-auto-reviewregisters a disposal effect inpackages/experimental/auto-review/src/index.ts:That migration is meant for a live plugin unload (remove/disable Auto review while the host keeps running). But the same disposal runs during the whole host shutdown:
application.shutdown.shutdown(0)from@deepseek-ai/dsh-desktop-host.UNLOADINGbefore child disposers run.ctx.sessions.list().permissionPresets.set(session, 'danger-full-access'), which appends durablepermission/preset,sandbox/mode, andapproval/policyevents to the session log.So a client restart performs a persistent permission downgrade that the user never requested.
Suggested upstream fix
Only run the full-access migration when the root fiber is still
ACTIVE, i.e. when the Auto review integration is being unloaded at runtime while the host itself keeps running.FiberState.ACTIVEis2; importing the enum from@deepseek-ai/cordisis preferable if it is exported. A numeric comparison (ctx.root.fiber.state === 2) is equivalent and avoids a new import.Local workaround
A small host-profile plugin,
dsh-auto-review-restart-fix, wrapsctx.permissionPresets.setand drops preset writes wheneverctx.root.fiber.state !== ACTIVE. Mount it before@deepseek-ai/dsh-experimental-auto-reviewindsh.profile.bundlesso its fiber disposes after the Auto review fiber during shutdown.Evidence
@deepseek-ai/dsh-experimental-auto-review/lib/index.js(compiled 0.2.0-rc.2) lines around theauto-review lifecycleeffect.@deepseek-ai/dsh-permission-presets/lib/index.jsPermissionPresetService.set()→apply()→session.append('permission/preset', ...).@deepseek-ai/cordis/src/fiber.ts:FiberStateand_unload()run disposers while the owning fiber isUNLOADING; the root staysACTIVEonly for runtime plugin unloads.@deepseek-ai/dsh-desktop-host/lib/index.jsstop()→application.shutdown.shutdown(0).Impact
All reactions