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

stacklok / toolhive / 27282426364

10 Jun 2026 02:12PM UTC coverage: 66.288% (+0.001%) from 66.287%
27282426364

push

github

web-flow
Prevent path traversal in LocalStore.getFilePath (#5464)

getFilePath constructed file paths with filepath.Join but never
verified the result stayed within basePath. A name like
"../../../etc/passwd" would resolve outside the state directory,
making GetReader, GetWriter, CreateExclusive, Delete, and Exists
all vulnerable to path traversal.

Fix: after filepath.Join (which calls filepath.Clean to resolve ".."
components), check that the result starts with basePath+separator
using the same containment pattern already established in
pkg/fileutils/contained.go. Update the #nosec G304 comments to
reflect that the check is now actually enforced.

Closes #4736

29 of 29 new or added lines in 1 file covered. (100.0%)

12 existing lines in 3 files now uncovered.

67293 of 101516 relevant lines covered (66.29%)

63.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.17
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc