Repository navigation
Description
Title
Windows executable-identity check false-positives on a renamed local Administrator account (RID 500)
Body
Summary
On a domain-joined corporate Windows machine, both the npm installer (install.js → verifyCandidate/activation) and the native install.ps1 refuse to install, because the binary's own "exact executable identity" / DACL self-check flags an ACE on the user's home directory (C:\Users\<user>) as belonging to an "untrusted identity."
Investigation showed the flagged SID (S-1-5-21-<machine-domain>-500) is not an orphaned or unexpected identity — it resolves cleanly via IdentityReference.Translate()/friendly-name lookup to <COMPUTERNAME>\<renamed-admin-account>. RID 500 is always the built-in local Administrator account; this org's standard hardening practice is to rename it to a non-default name, which is a very common enterprise security practice (CIS/NIST baselines recommend it).
The full ACL on the affected directory was entirely unremarkable:
| Identity | SID | Rights |
|---|---|---|
NT AUTHORITY\SYSTEM |
S-1-5-18 | FullControl |
BUILTIN\Administrators |
S-1-5-32-544 | FullControl |
<COMPUTERNAME>\<renamed local admin> |
S-1-5-21-...-500 | FullControl |
<DOMAIN>\<user> (the actual account owner) |
S-1-5-21-... | FullControl |
| AppContainer capability SID | S-1-15-3-... | ExecuteFile, Synchronize |
Root cause (best guess from the outside)
The identity-verification logic appears to hardcode trust for well-known, constant SIDs (S-1-5-18 SYSTEM, S-1-5-32-544 BUILTIN\Administrators), but has no equivalent allowance for a machine's own local built-in Administrator account (RID 500) under its actual machine SID — which is necessarily machine-specific and can't be hardcoded. Since renaming the built-in Administrator account is standard practice in many enterprises, this looks likely to affect a meaningful fraction of corporate Windows users, not just an edge case.
Suggested fix
Treat an ACE whose SID is <local-machine-SID>-500 (i.e., the box's own built-in Administrator/RID 500, regardless of display name) as trusted equivalently to BUILTIN\Administrators, since on Windows the local Administrators group and the local RID-500 account are effectively the same trust boundary. The local machine SID is derivable at runtime (e.g. via LookupAccountName on \\.\ Administrators or reading the current machine SID), so this doesn't require hardcoding anything machine-specific.
Environment
- codebase-memory-mcp v0.10.6 (Windows amd64)
- Windows 11 Enterprise, domain-joined
- Both
npm install -g codebase-memory-mcpand nativeinstall.ps1reproduce the same underlying rejection (activation/DACL check), though the npm path additionally surfaces a separate 15sverifyCandidatetimeout under load that's a distinct issue from this ACL false-positive.
Happy to provide more diagnostic output if useful — kept identifying details (hostname, domain, account names) redacted/generalized above since this is a corporate machine.
Activity
DeusData commentedon Aug 18, 2026
Thank you for the careful diagnosis and for redacting the corporate identifiers while preserving the SID shape. The report matches the current code:
win_sid_trusted()accepts the exact current user, SYSTEM, BUILTIN\Administrators, and TrustedInstaller, but it has no machine-relative RID 500 case. A renamed built-in Administrator ACE therefore reaches the generic untrusted-identity rejection exactly as you observed.This is routed as a high-priority Windows security and install bug. Any fix needs to preserve the local trust boundary: identify only the local machine account domain, never a domain account that happens to end in RID 500, keep the final runtime directory exact-owner protected, and cover renamed and disabled built-in Administrator states. Thank you for giving us enough evidence to distinguish this from another generic ACL report.
style(install): clang-format-20 the LSA helper declarations (#1705)
Merge pull request #2139 from DeusData/fix/decision-b-win-sid-trust
DeusData commentedon Sep 12, 2026
Fixed on
mainby #2139 (merge commit1b067e3b042da824edb27bb173df41afb2d27beb).The install-time executable-identity guard now trusts the local machine's built-in Administrator (RID-500), so a renamed local Administrator account no longer trips the false-positive you reported. Ships in v0.10.9.
Thanks for the clear repro — the renamed-admin case is exactly what the fix now tolerates.
fix(install): trust the local machine's built-in Administrator; name …
fix(install): trust the local machine's built-in Administrator; name …
style(install): clang-format-20 the LSA helper declarations (DeusData…
fix(install): trust the local machine's built-in Administrator; name …
style(install): clang-format-20 the LSA helper declarations (DeusData…