Skip to content

Security: dotfile guard checks the path before it is decoded #639

Closed

Description

@melvincarvalho

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

  1. added a commit that references this issue on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions