Skip to content

Windows executable-identity check false-positives on a renamed local Administrator account (RID 500) #1705

Closed

Description

@Lucas-AR97

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-mcp and native install.ps1 reproduce the same underlying rejection (activation/DACL check), though the npm path additionally surfaces a separate 15s verifyCandidate timeout 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

  1. added
    bugSomething isn't working
    securitySecurity vulnerabilities, hardening
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Aug 18, 2026
  2. DeusData commented on Aug 18, 2026

    @DeusData
    Owner

    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.

  3. added 2 commits that reference this issue on Sep 9, 2026
  4. DeusData commented on Sep 12, 2026

    @DeusData
    Owner

    Fixed on main by #2139 (merge commit 1b067e3b042da824edb27bb173df41afb2d27beb).

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.securitySecurity vulnerabilities, hardeningstability/performanceServer crashes, OOM, hangs, high CPU/memorywindowsWindows-specific issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions