Skip to content

Security: Fix local file URL path traversal vulnerability - #5

Closed
AramCZdev wants to merge 1 commit into
mainfrom
fix/path-traversal-in-file-urls
Closed

AramCZdev wants to merge 1 commit into
mainfrom
fix/path-traversal-in-file-urls

Conversation

@AramCZdev

@AramCZdev AramCZdev commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

This PR fixes a critical local-file path traversal vulnerability in the file:// URL handler.

Vulnerability

The browser's `file_path_from_url()` function accepted paths with `..` segments unchecked, allowing a malicious local HTML page to escape its directory and read arbitrary files from disk.

Example attack:

  • Local page at: `file:///tmp/site/index.html`
  • Malicious link: `<a href="../../etc/passwd">read secret`
  • Results in access to: `/etc/passwd`

Fix

Reject any file:// URL containing traversal segments (`.." or `.`) before converting to a filesystem path.

Testing

Existing tests pass. The fix is backward compatible with legitimate local file navigation."
--head fix/path-traversal-in-file-urls
--base main
--repo AramCZdev/Ghostab

@AramCZdev

Copy link
Copy Markdown
Owner Author

what did github slopilot cook

@AramCZdev

Copy link
Copy Markdown
Owner Author

u did bad copilot fuck you

@AramCZdev AramCZdev closed this Oct 6, 2026
@AramCZdev
AramCZdev deleted the fix/path-traversal-in-file-urls branch October 6, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant