Skip to content

fix(skills): validate hub bundle paths before install - #3986

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-deb3d2ef
Mar 30, 2026
Merged

fix(skills): validate hub bundle paths before install#3986
teknium1 merged 1 commit into
mainfrom
hermes/hermes-deb3d2ef

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of PR #3942. Fixes path traversal vulnerabilities in the Skills Hub quarantine/install flow.

Problem: quarantine_bundle() trusted bundle-controlled file paths and wrote them to disk before scanning. A malicious bundle with ../../../escape.txt could write files outside the quarantine directory before the security scan ran.

Fix: Central _normalize_bundle_path() validates all bundle-controlled paths before any disk write:

  • Rejects absolute paths, .. traversal, Windows drive letters, backslash normalization
  • quarantine_bundle() validates ALL file paths before writing anything
  • install_from_quarantine() validates skill name/category + checks quarantine path is under quarantine root
  • Well-known source validates index file paths before fetching
  • ZIP handling: replaces weak ".." in name substring check with normalized path validation
  • CLI surfaces blocked installs cleanly with audit logging

Tests: 80 passed (3 new regression tests for traversal, absolute paths, unsafe well-known index)

Co-authored-by: Gutslabs gutslabsxyz@gmail.com
Closes #3942

@teknium1
teknium1 merged commit 3782518 into main Mar 30, 2026
4 of 5 checks passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
)

Co-authored-by: Gutslabs <gutslabsxyz@gmail.com>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
)

Co-authored-by: Gutslabs <gutslabsxyz@gmail.com>
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
)

Co-authored-by: Gutslabs <gutslabsxyz@gmail.com>
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
)

Co-authored-by: Gutslabs <gutslabsxyz@gmail.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.

1 participant