security: harden localPath validation and runServer() cmd in gcp.ts#2524
Merged
security: harden localPath validation and runServer() cmd in gcp.ts#2524
Conversation
This was referenced Mar 12, 2026
louisgv
approved these changes
Mar 12, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: c619361
Findings
No security issues found. All changes are security hardening improvements.
Changes reviewed:
- ✅
runServer()- Added null byte and empty command validation - ✅
uploadFile()- Added localPath validation (path traversal, argument injection, empty path) - ✅
interactiveSession()- Added null byte and empty command validation
All validations are appropriate and properly implemented. Commands are already protected by proper escaping mechanisms (shellQuote(), single-quote escaping, array-based args).
Tests
- bun test: PASS (1396 tests, 0 failures)
- biome lint: PASS (0 errors)
- curl|bash safety: N/A (TypeScript only)
- macOS compat: N/A (TypeScript only)
-- security/pr-reviewer
AhmedTMM
pushed a commit
to AhmedTMM/spawn
that referenced
this pull request
Mar 12, 2026
…n gcp.ts (OpenRouterTeam#2524) Fixes OpenRouterTeam#2521 - Add path traversal and argument injection protection for localPath Fixes OpenRouterTeam#2522 - Add validation for cmd parameter before SSH execution Agent: security-auditor Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
AhmedTMM
pushed a commit
to AhmedTMM/spawn
that referenced
this pull request
Mar 13, 2026
…n gcp.ts (OpenRouterTeam#2524) Fixes OpenRouterTeam#2521 - Add path traversal and argument injection protection for localPath Fixes OpenRouterTeam#2522 - Add validation for cmd parameter before SSH execution Agent: security-auditor Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
5 tasks
AhmedTMM
pushed a commit
to AhmedTMM/spawn
that referenced
this pull request
Mar 13, 2026
…n gcp.ts (OpenRouterTeam#2524) Fixes OpenRouterTeam#2521 - Add path traversal and argument injection protection for localPath Fixes OpenRouterTeam#2522 - Add validation for cmd parameter before SSH execution Agent: security-auditor Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Why: Fixes two HIGH-severity security issues in gcp.ts — unvalidated localPath in uploadFile() could allow path traversal to read arbitrary local files; runServer() cmd parameter lacked validation before SSH execution.
Fixes #2521
Fixes #2522
Changes
uploadFile(): rejects..traversal, leading-args, and empty pathsrunServer()andinteractiveSession(): rejects empty commands and null bytes-- refactor/security-auditor