fix(security): route LobeHub skills fetches through guarded HTTP - #70356
fix(security): route LobeHub skills fetches through guarded HTTP#70356zapabob wants to merge 2 commits into
Conversation
## Summary - Move LobeHub index/agent fetches onto `_guarded_http_get` (SSRF + redirect hop checks). - Sanitize `agent_id` to reject path traversal / scheme-bearing identifiers. - Add unit tests for sanitization and guarded-fetch wiring. ## Salvage / credit Skills Hub SSRF campaign siblings (NousResearch#70334 ClawHub, NousResearch#70336 skills.sh, NousResearch#70343 GitHub hub) — LobeHub still used raw `httpx.get`.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for covering the remaining LobeHub fetch paths. The current main implementation still uses raw httpx.get at tools/skills_hub.py:2829 and tools/skills_hub.py:2843, while the shared guarded path at tools/skills_hub.py:302 provides SSRF-safe connection handling and redirect-hop validation.
Problems
tests/tools/test_lobehub_skills_http_ssrf.py:27only proves unsafe IDs return before the guard. It does not prove a valid per-agent fetch uses_guarded_http_get; that test would also pass if the valid path remained a rawhttpx.get.
Suggested changes
- Add a positive-path per-agent test with a valid ID, mocked guarded response, and assertions for the guarded URL and
timeout=15.
This is an automated hermes-sweeper review.
|
|
||
|
|
||
| def test_lobehub_fetch_agent_rejects_unsafe_id(): | ||
| src = LobeHubSource() |
There was a problem hiding this comment.
This covers rejection before any request, but not the successful agent-fetch route. Please add a valid-ID case that asserts _guarded_http_get receives https://chat-agents.lobehub.com/<id>.json with timeout=15; otherwise this test would still pass if that path used raw httpx.get.
|
looks mergeable The patch moves both LobeHub fetch paths onto the repository's SSRF- and policy-checked HTTP helper and rejects literal path, authority, and traversal delimiters before constructing agent URLs. Review setup: I reviewed a run-owned local rebase or patch replay against current GitHub Security evidence:
Not checked:
Signed: GPT-5.6-luna-max in Codex |
|
Closing this overlapping LobeHub slice in favor of consolidated survivor #70343. Its production change and positive guarded per-agent regression are preserved in #70343, now rebased onto official |
Summary
_guarded_http_get(SSRF + redirect hop checks).agent_idto reject path traversal / scheme-bearing identifiers.Salvage / credit
Skills Hub SSRF campaign siblings (#70334 ClawHub, #70336 skills.sh, #70343 GitHub hub) — LobeHub still used raw
httpx.get.Test plan
pytest tests/tools/test_lobehub_skills_http_ssrf.py -q