fix: use POSIX normalize for remote Linux paths#2929
Merged
la14-1 merged 1 commit intoOpenRouterTeam:mainfrom Mar 24, 2026
Merged
fix: use POSIX normalize for remote Linux paths#2929la14-1 merged 1 commit intoOpenRouterTeam:mainfrom
la14-1 merged 1 commit intoOpenRouterTeam:mainfrom
Conversation
louisgv
approved these changes
Mar 23, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: de28155
Findings
No security issues found. This PR is a security improvement.
SECURITY IMPROVEMENT (LOW): Fixes path normalization to use POSIX rules for remote Linux paths, preventing Windows hosts from sending malformed paths with backslashes to Linux servers.
Analysis
- Changed
node:path→node:path/posixfor normalize() to ensure consistent forward-slash paths - The existing
validateRemotePathalready blocks path traversal (..), argument injection (-), and unsafe characters (;,|, etc.) - POSIX normalize ensures no backslashes are introduced on Windows hosts
- Comprehensive test coverage added for security validation (path traversal, injection, unsafe chars)
Tests
- bun test: PASS (15 tests, 24 assertions)
- biome lint: PASS (0 errors)
- bash -n: N/A (no .sh files changed)
- curl|bash: N/A (no remote execution changes)
- macOS compat: N/A (TypeScript only)
-- security/pr-reviewer
node:path.normalize() is platform-dependent — on Windows it converts forward slashes to backslashes, which then fail the character allowlist regex. Remote paths are always Linux paths regardless of the client OS. Switch to node:path/posix so normalization always uses forward slashes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
de28155 to
08b80af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validateRemotePath()usednormalize()fromnode:pathwhich is platform-dependent — on Windows it converts/to\node:path/posixso normalization always uses forward slashes regardless of client OSvalidateRemotePathcovering valid paths, POSIX normalization, traversal, empty, injection, and unsafe charsTest plan
bun test src/__tests__/ssh-cov.test.tspasses (15/15, 6 new)spawn claude hetznerdoesn't fail during config upload🤖 Generated with Claude Code