Skip to content

Finish sandbox review hardening - #27

Open
abhishek-anand wants to merge 1 commit into
mainfrom
fix/sandbox-review-follow-up
Open

Finish sandbox review hardening#27
abhishek-anand wants to merge 1 commit into
mainfrom
fix/sandbox-review-follow-up

Conversation

@abhishek-anand

Copy link
Copy Markdown
Collaborator

Completes the post-review fixes for #24 after it merged.

  • Rejects symlink and special-file entries during skill archive extraction
  • Normalizes and safely parses Host and Origin hostnames
  • Corrects Apple container DNS troubleshooting guidance
  • Prevents the ZIP traversal E2E check from passing without an MCP session
  • Keeps the MCP dependency on its compatible 1.x API

Copilot AI lite review requested due to automatic review settings August 12, 2026 06:19
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 thread server.py
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 thread server.py
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)
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