Finish sandbox review hardening - #27
Open
abhishek-anand wants to merge 1 commit into
Open
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Pull request overview
This PR completes follow-up hardening work from #24 by tightening skill ZIP extraction safety, improving Host/Origin header parsing for REST endpoints, adjusting installer troubleshooting guidance, strengthening an E2E regression check, and pinning the MCP dependency to the compatible 1.x range.
Changes:
- Make skill archive extraction reject non-regular/special entries and avoid unsafe writes.
- Normalize and safely parse Host/Origin header hostnames using URL parsing.
- Update installer DNS troubleshooting text, harden an E2E traversal check precondition, and constrain
mcp[cli]to<2.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test-e2e.sh | Ensures the ZIP traversal E2E check cannot “pass” when no MCP session is established. |
| server.py | Adds safer skill ZIP extraction behavior and robust Host/Origin hostname parsing. |
| requirements.txt | Pins mcp[cli] to a compatible 1.x version range. |
| install.sh | Updates Apple container DNS troubleshooting guidance for coderunner.local. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+814
to
+826
| def _header_hostname(value: str, *, origin: bool = False) -> Optional[str]: | ||
| try: | ||
| parsed = urlsplit(value if origin else f"//{value}") | ||
| if origin and parsed.scheme.lower() not in {"http", "https"}: | ||
| return None | ||
| if parsed.username is not None or parsed.password is not None: | ||
| return None | ||
| if parsed.path or parsed.query or parsed.fragment: | ||
| return None | ||
| parsed.port | ||
| return parsed.hostname.lower() if parsed.hostname else None | ||
| except ValueError: | ||
| return None |
Comment on lines
+614
to
+624
| for member in archive.infolist(): | ||
| target = destination / member.filename | ||
| if member.is_dir(): | ||
| target.mkdir(parents=True, exist_ok=True) | ||
| continue | ||
|
|
||
| target.parent.mkdir(parents=True, exist_ok=True) | ||
| if target.is_symlink(): | ||
| raise ValueError(f"Unsafe symlink target in skill archive: {member.filename}") | ||
| with archive.open(member, "r") as source, target.open("wb") as output: | ||
| shutil.copyfileobj(source, output) |
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.
Completes the post-review fixes for #24 after it merged.