Repository navigation
fix(agent): stop refusing Windows installs over permissions Maple does not own - #1518
Conversation
…s not own Three Windows reports on 0.0.20 were Maple's own permission guard, not Windows failures: two stopped at verify-checker-image/foreign-write-ace and one at validate-installation-parent, and the same user's store was refused as not private. A relocated TEMP reproduces the first exactly: with TEMP=C:\Temp, signed 0.0.20 fails with MWI/installation/verify-checker-image/foreign-write-ace. - NSIS unpacks the payload into a per-run folder under %LOCALAPPDATA%\Maple Work Installer Staging that it creates with a protected ACL (SYSTEM, Administrators, owner), instead of $PLUGINSDIR, which inherits whatever TEMP allows. The native per-file checks are unchanged and now see only entries Maple set. A later install removes runs left over from a killed installer after an hour. - The folder page is gone: any folder outside the profile inherits write access for all signed-in users and could only fail. - The parent of a new install root is no longer judged by its ACL. The root is created below it with its own protected ACL, and the path stays pinned and free of links as before. - A Windows store object that only the user, SYSTEM or Administrators could have written, such as a SQLite file an elevated run left owned by Administrators, is restored to its private ACL instead of blocking the app forever. Anything another account could write is still refused, and the log now says which SID and access. - Installer reports add a detail line for permission, owner and link refusals: the kind of account (authenticated-users, other-domain-account-rid-1001, ...), access mask, inheritance, or the link type and its position in the path. No names or SIDs. Support codes are unchanged. - A client now waits 30 s, not 15 s, for a host it just spawned. On a slow PC or under antivirus the 114 MB executable alone can take longer than 15 s to start. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…llation The VM test of the PR package showed an Everyone-writable Maple Work Dev root reported as validate-installation-parent, though that branch checks the app root itself and never its parent. Support would look at the wrong folder. It now reports inspect-existing-installation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
NSIS unpacked its System plug-in into %TEMP% and locked that folder only for elevated installers, so a TEMP shared with other accounts (C:\Temp) let them replace the DLL before it loaded. Unpack plug-ins into a folder under the profile's staging root before the first plug-in call. The root now inherits the profile's entries, which name the user, instead of a protected ACL whose OWNER RIGHTS entry followed whoever created it. A root left behind by an interrupted elevated run (owned by Administrators) blocked later normal installs at stage 21. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Both findings are real. P1, System.dll loaded from TEMP. Confirmed in NSIS's own source: The installer now builds the plug-in folder before its first plug-in call:
The only TEMP use left is the solid compressor's decompressed data block. NSIS opens it with share mode 0 and P2, an Administrators-owned root blocks normal installs. Agreed. The root is now created with plain I kept each run's own folder as Your exact fixture, a root with the old protected ACL owned by Administrators, still stops at stage 21 ("creating the installer's working folder"). New code never produces that root, and no release did either, so please delete it on test machines. Related but out of scope: the NSIS uninstaller copies itself to Verified on the x64 QA VM with the CI Dev package
A silent run still leaves one empty |
Three Windows reports on 0.0.20 were all Maple's own permission guard, not Windows failing (
Windows error: nonein each):MWI/installation/verify-checker-image/foreign-write-ace%TEMP%inherits whateverTEMPallowsMWI/installation/validate-installation-parent/foreign-write-aceReproduced on the x64 QA VM with the signed releases:
TEMP=C:\Tempplus signed 0.0.20 gives exactlyMWI/installation/verify-checker-image/foreign-write-aceat stage 24.store-v1\db\maple.dbowned by Administrators (the user keeps full control) shows the user's "Choose a private local data location" screen exactly.Our clean test machines never carry these permissions; real PCs often do (a moved
TEMP, a profile copied from an old PC, domain groups, folders under a drive root).Changes
%LOCALAPPDATA%\Maple Work Installer Staging\<pid>-<tick>, created withCreateDirectoryWand a protected ACL (D:PSYSTEM, Administrators, OWNER RIGHTS) through NSIS's own System plugin. Files written into it inherit only those entries, so the native per-file checks are unchanged and pass. Each run gets a new folder, and an existing one is never adopted. NSIS deletes the folder when it finishes; a later install removes runs older than an hour that a killed installer left behind.InstallDirRegKeyand/D=still apply.installation_parentkeeps the link-free, pinned-path and directory checks but no longer reads permissions on a folder Maple doesn't own; the new root still gets its own protected ACL. The residual risk is another non-admin account with Full Control on%LOCALAPPDATA%\Programs, which no default profile has and which every per-user app shares.detail:line: the kind of account (authenticated-users,other-domain-account-rid-1001,same-domain-account-rid-512-domain-admins,capability, …), the access mask and whether the entry is inherited, or the link type and its position in the path. No names, SIDs or domain identifiers. Support codes are unchanged.main, so every normal launch of 0.0.19 showed "Maple host did not start". The idle exit and handshake timeouts stay at 15 s.Testing
makensis -V2 -WXwith NSIS 3.12 from the pinned nixpkgs.just ci-lintandjust ci-test(pre-commit) on macOS. Windows code is compiled and tested by theci:windowslanes.TEMP=C:\Tempand Users:Modify onProgramsverify-checker-image/foreign-write-acemaple.dbowned by AdministratorsStore maple.db is owned by SYSTEM or Administrators; Maple restored its private permissionsgeneration.jsonwritable by EveryoneS-1-1-0 can write to it (access 0x00100116, explicit)detail: account: everyone; access: 0x00100116; inherited: no; object: folder(now reported asinspect-existing-installation)ARM64 is built by CI only; there is no ARM64 VM yet. The first CI run's
agent-test,agent-package-linuxandresearch-desktop-windowsfailures were GitHub release downloads returning HTTP 504 (linuxdeploy, Tauri bundler), not this change.🤖 Generated with Claude Code