fix(skills): block path traversal during quarantine install - #1936
fix(skills): block path traversal during quarantine install#1936Gutslabs wants to merge 1 commit into
Conversation
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) SummarySecurity fix that prevents path traversal attacks during skill quarantine and installation. A malicious skill bundle could previously use ArchitectureThe fix is well-placed:
IssuesWarning — Redundant After file_dest = dest / rel_pathThis is safe because file_dest = dest / safe_rel_path
assert file_dest.resolve().is_relative_to(dest.resolve()), f"path escaped quarantine: {safe_rel_path}"This is optional since the current validation is correct, but a belt-and-suspenders Suggestion — The if normalized.startswith("//") or normalized.startswith(r"\\"):
raise ValueError(...)Minor since the backslash→forward-slash normalization already converts Cross-file impact
Assessmentapprove ✅ — Solid security fix that addresses a real attack vector (path traversal via crafted skill bundles). The centralized |
1 similar comment
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) SummarySecurity fix that prevents path traversal attacks during skill quarantine and installation. A malicious skill bundle could previously use ArchitectureThe fix is well-placed:
IssuesWarning — Redundant After file_dest = dest / rel_pathThis is safe because file_dest = dest / safe_rel_path
assert file_dest.resolve().is_relative_to(dest.resolve()), f"path escaped quarantine: {safe_rel_path}"This is optional since the current validation is correct, but a belt-and-suspenders Suggestion — The if normalized.startswith("//") or normalized.startswith(r"\\"):
raise ValueError(...)Minor since the backslash→forward-slash normalization already converts Cross-file impact
Assessmentapprove ✅ — Solid security fix that addresses a real attack vector (path traversal via crafted skill bundles). The centralized |
|
Thanks @Gutslabs — same vulnerability class, valid catch. Closing as redundant: this was independently fixed in #3986 (merged 2026-03-30), which landed Appreciate the report and the regression tests — please keep them coming. |
What does this PR do?
Fixes a path traversal issue in Skills Hub quarantine/install handling.
Previously,
quarantine_bundle()trusted bundle-controlled file paths and wrote them to disk before scanning. That meant a malicious bundle could use absolute paths or..segments to write outside the quarantine directory before the security scan ran.This change validates bundle names, bundle file paths, and install targets before writing or moving anything on disk.
Type of Change
Changes Made
How to Test
source .venv/bin/activatepytest -o addopts='' tests/tools/test_skills_hub.py -q/tmp/file.txtor../../../outside.txtare rejectedassets/...still install correctly