You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DSH Windows 沙箱给工作区根目录打可继承的 Low 完整性标签,导致目录内构建的产物以低完整性运行、写不了工作区外的对象(造成多个人、多种工具的静默故障)
#9649
The Windows sandbox provisions the workspace root with an inheritable Low integrity label. Every file created or copied inside inherits it, and on Windows a process launched from an image labeled Low runs at Low integrity — so build outputs produced inside the workspace silently lose the ability to write Medium-integrity objects (paths outside the workspace, the user's own HKCU keys) even though the ACLs grant the user Full Control, because the mandatory-label check precedes the DACL. We hit several hard-to-diagnose failures this way: a service asserting on its startup self-check, RegOpenEx ACCESS_DENIED popups from a desktop tool, and processes that could not create their own log files (making failures invisible). It also fires when the user simply double-clicks an executable they built, i.e. the AI sandbox silently changes the runtime behavior of the product. Suggest not confining by labeling the workspace tree, and at minimum making it visible, documented and undoable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary (EN)
The Windows sandbox provisions the workspace root with an inheritable Low integrity label. Every file created or copied inside inherits it, and on Windows a process launched from an image labeled Low runs at Low integrity — so build outputs produced inside the workspace silently lose the ability to write Medium-integrity objects (paths outside the workspace, the user's own
HKCUkeys) even though the ACLs grant the user Full Control, because the mandatory-label check precedes the DACL. We hit several hard-to-diagnose failures this way: a service asserting on its startup self-check,RegOpenExACCESS_DENIED popups from a desktop tool, and processes that could not create their own log files (making failures invisible). It also fires when the user simply double-clicks an executable they built, i.e. the AI sandbox silently changes the runtime behavior of the product. Suggest not confining by labeling the workspace tree, and at minimum making it visible, documented and undoable.环境
<workspace>(如C:\work\repo),产物目录记作<workspace>\out\bin现象(均已复现)
<app>.exe启动自检时,往工作区之外的数据/资源目录(记作D:\data\res)写一个探测文件 →Permission denied (errno 13)→assert崩溃,服务无法启动。KEY_ALL_ACCESS打开自己的设置键HKCU\Software\<Vendor>\<Product>→RegOpenEx返回ACCESS_DENIED→ 弹框。该键的 DACL 明确给了当前用户FullControl(甚至还为受限令牌单独留了ReadKey)。根因(实测数据)
icacls <workspace> | findstr Mandatory→Mandatory Label\Low Mandatory Level:(OI)(CI)(NW)(显式、可继承)。Low Mandatory Level:(I)(NW))。whoami /groups→Mandatory Label\Low Mandatory Level (S-1-16-4096)C:\Windows\System32\cmd.exe(Medium 标签、同一父进程令牌)→High Mandatory LevelFullControl也照样被拒。实测从该进程执行reg add HKCU\Software\<Vendor>\<Product>失败;把产物目录/setintegritylevel Medium摘牌后同一命令立刻成功。为什么这反直觉、也和其他 agent 的做法不一致
HKCU下用户自己的注册表键);建议
<workspace>\.dsh\),不要污染整棵工作区。*.exe与构建输出目录);dsh sandbox labels list|clear),而不是让用户去啃icacls;HKCU下用户自己的键”。临时规避(供其他人参考)
(注意:沙箱下次配置该工作区时会重新打上。)
最小复现(可选,供维护者验证)
All reactions