Skip to content

Conversation

@ddworken
Copy link
Contributor

Add path validation to prevent directory traversal attacks when unpacking DXT files. The fix validates that extracted file paths remain within the intended output directory before writing files to disk.

🤖 Generated with Claude Code

ddworken and others added 3 commits July 18, 2025 08:31
Add path validation to prevent directory traversal attacks when unpacking DXT files.
The fix validates that extracted file paths remain within the intended output directory
before writing files to disk.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Use path.sep instead of hardcoded '/' separator to ensure path validation
works correctly on both Windows and Unix systems. This fixes failing tests
on Windows while maintaining security protection against directory traversal.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ddworken ddworken requested a review from felixrieseberg July 18, 2025 16:31
@felixrieseberg felixrieseberg merged commit 08b34f4 into anthropics:main Jul 18, 2025
6 checks passed
bthompson-sys pushed a commit to bthompson-sys/mcpb that referenced this pull request Oct 28, 2025
* fix: prevent zip slip attacks in DXT unpack function

Add path validation to prevent directory traversal attacks when unpacking DXT files.
The fix validates that extracted file paths remain within the intended output directory
before writing files to disk.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* fix: make zip slip protection cross-platform compatible

Use path.sep instead of hardcoded '/' separator to ensure path validation
works correctly on both Windows and Unix systems. This fixes failing tests
on Windows while maintaining security protection against directory traversal.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants