Skip to content

fix(server): refuse a pre-existing Windows service data folder others control - #817

Merged
fclairamb merged 7 commits into
mainfrom
fix/windows-service-dir-trust
Nov 9, 2026
Merged

fclairamb merged 7 commits into
mainfrom
fix/windows-service-dir-trust

Conversation

@fclairamb

Copy link
Copy Markdown
Owner

Fixes GHSA-2j47-9jj8-63vr (only main since #802 is affected; no release ships the native Windows service yet).

solidping service install left an existing data folder (default C:\ProgramData\SolidPing) as it was. Any local user can create that folder before the install and stays its owner, so they could read the LocalSystem service's secrets or supply its config.yml.

Fix (server/cmd_service_windows.go): an existing folder is reused only when it is

  • a plain folder, not a link or a junction (opened with FILE_FLAG_OPEN_REPARSE_POINT, so nothing is followed);
  • owned by SYSTEM, Administrators or the installing user;
  • protected (no inheritance) with allow rules for SYSTEM and Administrators only;
  • and everything inside is neither a link nor owned by someone else, nor opened to another account.

Otherwise install fails before registering the service, with the reason and "delete the folder or choose another --dir". Re-applying the ACL alone would not do: the owner can always rewrite it.

Tests (cmd_service_windows_test.go, run by the Windows service job, skipped without an elevated token):

  • positive control: a folder from a previous install, with files and folders added since, is reused;
  • refused: inherited ACL, extra grant to Users, a file instead of a folder, a junction to a protected folder, a junction inside, a child granting Users, an untrusted owner.
  • The CI job now also reinstalls on the folder the service filled (must pass) and installs on a pre-created folder (must fail, no service registered).

Docs: installation/windows.md explains when an existing folder is reused, and the NSSM migration now says to copy files rather than move them, since a moved file keeps its old ACL.

Not checked locally: the Windows code only runs on Windows. Locally it passes GOOS=windows go vet, a test compile and golangci-lint. The Windows service CI job is its real test.

🤖 Generated with Claude Code

… control

`solidping service install` created the data folder with a protected
SYSTEM/Administrators-only ACL, but left a folder that already existed as
it was. Any local user may create a folder under ProgramData and keeps
control of it as its owner, so they could read the secrets of the
LocalSystem service or supply its configuration (GHSA-2j47-9jj8-63vr).

An existing folder is now reused only if it is a plain folder (not a link
or a junction), owned by SYSTEM, Administrators or the installing user,
with a protected DACL granting only SYSTEM and Administrators, and with
nothing inside that is a link, belongs to another account or grants
anyone else access. Otherwise install fails before registering the
service and says what to do. Re-applying the ACL would not be enough: an
owner can always rewrite it.

The Windows CI job now also checks that a reinstall reuses the folder of
the previous install and that a pre-created folder is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.24%. Comparing base (8a0cb2f) to head (09f3bfd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #817   +/-   ##
=======================================
  Coverage   89.23%   89.24%           
=======================================
  Files        1333     1333           
  Lines      136158   136158           
=======================================
+ Hits       121499   121509   +10     
+ Misses      14650    14640   -10     
  Partials        9        9           

see 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fclairamb
fclairamb enabled auto-merge (squash) November 9, 2026 08:06
@fclairamb
fclairamb merged commit b1832b5 into main Nov 9, 2026
38 checks passed
@fclairamb
fclairamb deleted the fix/windows-service-dir-trust branch November 9, 2026 10:36
@fclairamb fclairamb mentioned this pull request Nov 9, 2026
fclairamb added a commit that referenced this pull request Nov 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.45.0](v0.44.3...v0.45.0)
(2026-11-09)


### Features

* dashboard glance strips, failed sign-in account names, log noise fixes
([#824](#824))
([659c52c](659c52c))
* **dashboard:** 24h / 7d / 30d availability window, saved per user
([#821](#821))
([283a28e](283a28e))
* **mcp:** sharpen tool descriptions for Glama scoring
([#825](#825))
([ca305f1](ca305f1))
* **server:** run as a native Linux systemd service
([#819](#819))
([8a0cb2f](8a0cb2f))
* **server:** run as a native macOS launchd service
([#811](#811))
([c6612ea](c6612ea))
* **server:** run as a native Windows service, no NSSM
([#802](#802))
([c66c947](c66c947))
* **telegram:** explicit /support mode instead of capturing every
message ([#820](#820))
([571607e](571607e))


### Bug Fixes

* **auth:** admit by email address only when the email is verified
([#818](#818))
([91992fe](91992fe))
* batch of production-log and Slack issues
([#808](#808))
([580d09c](580d09c))
* **deps:** update github.com/dop251/goja digest to d6eaa50
([#800](#800))
([60b7443](60b7443))
* **deps:** update github.com/dop251/goja digest to d8dfb4d
([#810](#810))
([e11b926](e11b926))
* **deps:** update go dependencies (non-major)
([#806](#806))
([1c59927](1c59927))
* **deps:** update go dependencies (non-major)
([#822](#822))
([ec0aebf](ec0aebf))
* **deps:** update module github.com/aws/aws-sdk-go-v2/credentials to
v1.20.17 ([#823](#823))
([27efc51](27efc51))
* **deps:** update module github.com/crewjam/saml to v0.6.3
([#807](#807))
([0f06336](0f06336))
* **deps:** update module github.com/wneessen/go-mail to v0.8.2
([#812](#812))
([3670206](3670206))
* **oncall:** record on-call override changes in the audit log
([#816](#816))
([4561f41](4561f41))
* serve robots.txt, indexable on solidping.io only
([#809](#809))
([3512833](3512833))
* **server:** refuse a pre-existing Windows service data folder others
control ([#817](#817))
([b1832b5](b1832b5))
* **vendorstatus:** drop datadog and atlassian from the catalog
([#814](#814))
([d3397c5](d3397c5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant