• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 30927597747
70%

Build:
DEFAULT BRANCH: main
Ran 04 Aug 2026 04:14PM UTC
Jobs 1
Files 870
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Aug 2026 04:07PM UTC coverage: 69.941% (-0.02%) from 69.96%
30927597747

push

github

web-flow
Set Windows DACL on discovery directory under LOCALAPPDATA (#5951)

* Set Windows DACL on discovery directory

os.Chmod is advisory on NTFS, so the discovery directory under
%LOCALAPPDATA% could keep inherited ACEs (Everyone, other interactive
users). A local attacker who can write server.json can redirect the
npipe URL and steal the discovery nonce on the next health check.

On Windows, replace the directory DACL with a protected ACL granting
GenericAll only to the process user and SYSTEM (create and existing-dir
paths). Non-Windows keeps os.Chmod. Windows tests assert no other
interactive users remain; POSIX mode assertions skip on Windows.

Fixes #5217

Signed-off-by: stantheman0128 <stanshih888@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* Lock down discovery dir before startup trusts it

Review follow-up. The DACL work only ran inside writeServerInfoTo, which is
the last step of startup: pkg/api creates the directory, takes
server.json.lock inside it, and runs Discover before it ever writes. A
StateRunning result returns before the write, so a directory left loose by
an earlier run stayed loose for the whole startup, and the server.json in it
was trusted regardless.

Move the lockdown into discovery.EnsureSecureDir and call it from
writeDiscoveryFile ahead of the lock and Discover. Restrict the intermediate
toolhive directory as well as the server leaf: inherited Modify on the
intermediate carries DELETE, so another interactive user could rename it
aside, recreate the chain with an ACL of their own, and leave the protected
leaf unread.

Validate ownership before treating a directory as locked down. Owners keep
WRITE_DAC implicitly, so replacing the DACL of a directory somebody else
pre-created is cosmetic, since that owner can make it permissive again. Fail
closed unless the owner is the process user, SYSTEM, or Administrators; a
standard user cannot create a directory owned by any of those, and an
elevated thv serve legitimately ... (continued)

51 of 122 new or added lines in 5 files covered. (41.8%)

8 existing lines in 4 files now uncovered.

82990 of 118658 relevant lines covered (69.94%)

98.04 hits per line

Uncovered Changes

Lines Coverage ∆ File
52
45.11
-12.78% pkg/server/discovery/discovery.go
7
46.4
-0.34% pkg/api/server.go
6
62.5
pkg/server/discovery/secure_dir_other.go
3
81.25
pkg/server/discovery/permissions_other.go
3
0.0
pkg/server/discovery/validate_dacl_other.go

Coverage Regressions

Lines Coverage ∆ File
3
71.85
-1.11% pkg/ignore/processor.go
2
45.11
-12.78% pkg/server/discovery/discovery.go
2
94.77
-1.31% pkg/vmcp/composer/dag_executor.go
1
46.4
-0.34% pkg/api/server.go
Jobs
ID Job ID Ran Files Coverage
1 30927597747.1 04 Aug 2026 04:14PM UTC 870
69.94
GitHub Action Run
Source Files on build 30927597747
  • Tree
  • List 870
  • Changed 8
  • Source Changed 2
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30927597747
  • 4b5b53d0 on github
  • Prev Build on main (#30892520842)
  • Next Build on main (#30930694184)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc