Skip to content

fix: prevent zip slip attacks in DXT unpack function#74

Merged
felixrieseberg merged 3 commits intomodelcontextprotocol:mainfrom
ddworken:dworken/zipslip
Jul 18, 2025
Merged

fix: prevent zip slip attacks in DXT unpack function#74
felixrieseberg merged 3 commits intomodelcontextprotocol:mainfrom
ddworken:dworken/zipslip

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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@ddworken ddworken requested a review from felixrieseberg July 18, 2025 16:31
@felixrieseberg felixrieseberg merged commit 08b34f4 into modelcontextprotocol:main Jul 18, 2025
6 checks passed
bryan-anthropic pushed a commit to bryan-anthropic/mcpb that referenced this pull request Oct 28, 2025
…tocol#74)

* 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 <noreply@anthropic.com>

* 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 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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