Skip to content

Fix path traversal and concurrency race conditions issues#212

Merged
thelovekesh merged 36 commits into
mainfrom
fix/traversal-issues
May 5, 2026
Merged

Fix path traversal and concurrency race conditions issues#212
thelovekesh merged 36 commits into
mainfrom
fix/traversal-issues

Conversation

@thelovekesh
Copy link
Copy Markdown
Collaborator

  • Add validation to prevent path traversal
  • Add flock while installing/uninstalling packages to avoid fs race conditions
  • Remove complex locking in http caching API

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

📦 wpm cli builds 📦

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces workspace-level locking to prevent concurrent wpm processes and implements strict size limits for archives to mitigate security risks like zip bombs. The installer has been refactored to use a staging directory for atomic updates with rollback support, and filesystem operations now include exponential backoff for improved reliability on Windows. Additionally, the PR adds comprehensive validation for package names and project paths. Review feedback identified a discrepancy in a size limit error message, suggested adding a timeout to rollback operations, and recommended more descriptive error messages for cache metadata failures.

Comment thread pkg/archive/archive.go
Comment thread pkg/pm/installer/installer.go
Comment thread pkg/api/cache.go
@thelovekesh thelovekesh force-pushed the fix/traversal-issues branch from 750e69a to e472f6f Compare May 5, 2026 18:13
@thelovekesh thelovekesh merged commit 007f4ae into main May 5, 2026
17 checks passed
@thelovekesh thelovekesh deleted the fix/traversal-issues branch May 5, 2026 18:19
@thelovekesh thelovekesh added enhancement New feature or request core changes made in cli core api labels May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core changes made in cli core api enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant