{"id":"GHSA-964w-f6gj-5236","revision":"f3ecfc88ffcb465a8ee932a3c06710f7","records":[{"revision":"f3ecfc88ffcb465a8ee932a3c06710f7","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-964w-f6gj-5236","aliases":["CVE-2026-66064","GO-2026-6134"],"title":"goshs has ACL Bypass & Path Traversal","description":"## Summary\n\n`sendFile` derives the served filename from the raw request path while opening the file from the cleaned path, so appending a trailing slash empties the derived name and defeats both the never-serve rule for the ACL file and the block list. \n\n## Finding (Medium): trailing-slash ACL and hidden-file bypass\n\nhttpserver/handler.go, sendFile (lines 789-801) takes the filename from the RAW req.URL.Path while the file itself is opened from the filepath.Clean-ed path. The two disagree, and a trailing slash makes the derived name the empty string. Both protections key on that derived name, so both are defeated: the rule that never serves the .goshs ACL file, and the acl.Block list.\n\nMeasured, with negative controls:\n\n```\nGET /blocked/secret.txt    -> 404          (control, correctly blocked)\nGET /blocked/secret.txt/   -> 200 + contents\nGET /blocked/.goshs/       -> 200, returns the ACL file itself,\n                              including the admin:$2a$... bcrypt hash\n```\n\nUnauthenticated when the ACL is configured block-only (common usage). Stated precisely: AUTHENTICATION IS NOT BYPASSED. An unauthenticated request against a directory protected by authentication still returns 401 under the same trick; I tested that. The claim is specifically that the block list and the ACL-file protection are bypassed. In-tree evidence that sendFile is the defect: the sibling handlers doDir and bulkDownload both derive the name correctly; sendFile is the lone outlier.\n\n## Suggested fixes\n\n1. Derive the served filename from the same cleaned path used to open the file, so the authorization decision and the file access cannot disagree.\n\n## Tooling\n\nAI assistance was used while investigating. The finding was reproduced against a running server on loopback with negative controls, including the 404-versus-200 pair and the authenticated-directory control that shows authentication is not affected.","state":0,"publishedAt":"2026-07-28T22:26:28+00:00","modifiedAt":"2026-08-18T15:10:57.6156063+00:00","affected":[{"ecosystem":"Go","name":"github.com/patrickhener/goshs/v2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.1.5-0.20260727065949-f3ef599e4091"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"goshs.de/goshs/v2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.1.5-0.20260727065949-f3ef599e4091"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/patrickhener/goshs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"1.1.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"goshs.de/goshs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"1.1.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/goshs-labs/goshs/security/advisories/GHSA-964w-f6gj-5236","https://github.com/goshs-labs/goshs/pull/222","https://github.com/goshs-labs/goshs/commit/f3ef599e409151d1380866e47de8b1afb0bb54fa","https://github.com/goshs-labs/goshs"],"sourceUrl":"https://github.com/advisories/GHSA-964w-f6gj-5236","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-964w-f6gj-5236","identifiers":["GHSA-964w-f6gj-5236","CVE-2026-66064","GO-2026-6134"]},"retained":false,"historicalAffected":[]}],"coverage":[]}