You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: dotfile guard checks the path before it is decoded #639
The dotfile guard in src/server.js inspects path segments of the raw request.url, but paths are percent-decoded later when they are resolved to files (src/utils/url.js). The guard and the file lookup can therefore disagree about what a path means, so the guard does not reliably protect dotfiles.
Severity: please treat as a security bug. The guard exists to stop exposure of .git/, .env and .htpasswd, and files like these can hold secrets. Git config in particular may hold a nostr.privkey. Confirmed on JSS 0.0.219. The guard is unchanged on gh-pages at 600d0ae from reading the code; that version has not been run.
Suggested fix
Decode each path segment before checking it, and fail closed if decoding fails.
Apply the same check to the resolved filesystem path, so the guard and the lookup can't disagree.
Add regression tests for encoded forms of dotfile segments, including a request for a real .git/config.
Follow-up
jspod pins javascript-solid-server to >=0.0.219 <0.0.222, so it needs a release with a raised range to pick up the fix.
Exact reproduction details are deliberately left out of this public issue.
Activity
Merge pull request #640 from JavaScriptSolidServer/fix/639-dotfile-gu…
bump version to 0.0.225