Repository navigation
Replies: 2 comments
你这条把已知代价讲得比文档更清楚——尤其是"ACL 里看不到"这一点1. 标签的常驻性,文档是承认的
⇒ 你观察到的"撤销授权时标签不回滚"与这条一致。你的增量在于把后果说清了:在工作区里构建出来的可执行文件继承 Low 标签 ⇒ Windows 以低完整性启动它 ⇒ 低完整性进程禁止写 Medium 的 这一段是本轮同族报告里最好的一条影响面分析,建议原样保留——它解释了为什么用户自助排查会一筹莫展。 2. 建议把"三样一次写入"补上(能帮维护者定位)同 README ⇒ 所以"撤销授权"若要真正干净,必须回滚三样,而不是只去标签。建议在诉求里明确写"撤销应当回滚本次授权的全部三项编辑"——这比"请清理标签"精确得多,也让修法可验收。 3. 一个现成工具(建议先跑)本仓自带诊断脚本: 跑它可把"我用 4. 这条与同族的另外几条最近同族报告至少有四条(工作区内写不进 / 其他工具写不进 / 离开 DSH 后构建坏掉 / Electron 程序起不来 / 你现在这条"构建出的 exe 跑不起来")。建议互相引用——它们合起来证明这不是个别现象,而是"常驻授权缺少清理路径"这一个设计缺口。 5. 最该提的诉求
6. 版本你在 一条边界我确认的是文档承认常驻标签、以及一次授权写三样这两点(它们支撑你的归因与"回滚三样"的诉求)。你机器上的实际标签与拒绝项以第 3 节脚本的输出为准。 |
|
感谢官方的确认和精确补全,特别是关于「一次 SetNamedSecurityInfoW 写入三样(能力 SID ACE + FILE_DELETE_CHILD 拒绝 + Low 标签)」的细节。 关于官方提出的几点要求:
完整的 .jsonl 诊断报告见附件
|
Uh oh!
There was an error while loading. Please reload this page.
Windows 沙箱:撤销工作区授权后会留下一个可继承的“低完整性”标签,且在该工作区内构建的可执行文件此后将无法正常运行
中文摘要
workspace-write模式下,DSH 给工作区根目录写了一个可继承的「低完整性 + 禁止向上写」强制标签(
Mandatory Label\Low Mandatory Level:(OI)(CI)(NW))。撤销授权时这个标签不会被回滚,于是工作区里之后生成的一切对象(尤其是
build\...\App.exe)都带上 Low 标签;Windows 会以低完整性启动这类可执行文件,而低完整性进程禁止写入 Medium 级别的
%TEMP%。这个拒绝在 ACL 里完全看不到(
icacls %TEMP%没有任何拒绝项),所以用户用icacls/takeown//reset/ 改TEMP全都无效,表现为"Flutter 启动 VM(应用)时完全拿不到 Temp 权限"。修复建议:撤销授权时把授权前的标签 ACL 写回去
(
readCurrentSecurity已经读到了旧值),或提供一条官方的重置命令。Summary
In a Windows session whose file policy is
workspace-write, DSH provisions the workspace write grant byediting the folder's security descriptor. Part of that edit is a mandatory integrity label:
Two consequences, both silent and both very hard for a user to diagnose:
danger-full-access, the workspace root keeps the Low label. Every object created afterwards inside theworkspace inherits it — including the project's own build outputs.
denied writes to
%TEMP%(and%LOCALAPPDATA%), because those objects are Medium integrity and thelabel carries
NO_WRITE_UP. The denial is not visible in the ACL —icacls %TEMP%shows no denyentry at all, and
%TEMP%'s permissions are perfectly normal.So a Windows project that builds and then runs its own artifacts breaks in a way that looks like a
Windows/Temp permission problem and cannot be fixed with
icacls,takeown,icacls /reset, or by pointingTEMPsomewhere else.Concrete user-visible symptom
Flutter Windows desktop project (
flutter run -d windows):flutter_toolsitself runs fromD:\flutter\...(outside the workspace) → the tool is Medium, and itcreates
%TEMP%\flutter_tools.*normally.…\build\windows\x64\runner\Debug\App.exe, which was produced inside theLow-labelled workspace → the app runs at Low integrity → the app and its Dart VM cannot create
anything under
%TEMP%.Access is deniedfor temp files, faileddebug connection / VM service, and app crashes (
0xc000041dinflutter_windows.dllwas observed in theWindows event log for this project, with
%TEMP%ACL clean).icacls "%TEMP%" /grant <user>:(OI)(CI)F /T,takeown /F "%TEMP%" /R /A,icacls "%TEMP%" /reset /T,$env:TEMP=D:\SomeOtherFolder(also Medium), firewall rules for the VMservice port.
Minimal reproduction (no Flutter needed)
Why this is a harness bug (and not user error)
directory: it is the user's real project directory, and the label is inheritable to
OI(objects), so itcontaminates build outputs that outlive the sandbox session.
readCurrentSecurityalready reads the previous label ACL, so thevalue needed to restore it is available at the point of the edit.
on a folder whose permissions look perfect.
Impact is not Flutter-specific: any Windows workspace that produces executables (CMake/C++, Rust, .NET,
Node native modules, Flutter desktop) will silently build Low-integrity binaries that then fail on writes to
%TEMP%/%LOCALAPPDATA%when they are run outside the sandbox. As a secondary effect, Low-integrity filesare writable by any Low-integrity process, which is a small security regression for a user's source tree.
Suggested fixes
readCurrentSecurityand write it back in the samerevokeWritepath that removes the capability ACE, soa grant is a true round-trip. If the label was not present before the grant, remove it.
ACE this module added; treat the label like the revocable capability SID it belongs to.
dshcommand or a documentedicacls /setintegritylevelrecipe, including thegrant→setintegritylevelorder needed for childrenwhose ACL grants only
Authenticated Users:(M)), plus a warning in the session when a grant is revokedwhile a label is in place.
with the capability SID only (the
S-1-4-…ACE) and granting that SID on the private temp plus theworkspace, without lowering the integrity of the user's own tree.
All reactions