Files
Chronos/src/Titano.Server/Security
Claude 047cddfe7b fix(server): keep Windows secrets private and the service out of user folders
On Windows the data folder sits in %ProgramData%, whose ACL let every local
user read the database, the password-less TLS key and the temporary admin
password, and create a server.json the LocalSystem service would load
(SRS-02, SRV-2). The folder now gets a protected DACL (SYSTEM,
Administrators, the server's account) at every start when it names anyone
else, which also replaces what the files inside inherited; server.pfx and
initial-admin-password.txt are written with their own protected DACL, and
with mode 0600 elsewhere. A folder whose ACL cannot be changed stops the
start with a clear message.

--install-service registered a LocalSystem service from any folder, so a
per-user install or an unpacked zip handed SYSTEM to that user (SRS-06). It
now refuses, with a localized one-line reason, unless the program folder is
inside Program Files and no account besides SYSTEM, Administrators,
TrustedInstaller or the registering administrator can change it or any file
below it (under dotnet, the host's folder too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:27:06 +00:00
..