fix(security): validate HONCHO_BASE_URL against SSRF before requests - #4986
Open
maymuneth wants to merge 1 commit into
Open
fix(security): validate HONCHO_BASE_URL against SSRF before requests#4986maymuneth wants to merge 1 commit into
maymuneth wants to merge 1 commit into
Conversation
Collaborator
|
Related to #4984 (same SSRF validation pattern for RetainDB plugin). |
This was referenced May 26, 2026
teknium1
reviewed
Jul 12, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for targeting the Honcho endpoint path. There are blockers in the current patch.
Problems
plugins/memory/honcho/client.py:192in the PR patch indentsif base_url:with six spaces beneath an eight-space method body, so the patch is not valid Python.- The proposed
is_safe_url()call would reject the supported self-hosted defaulthttp://localhost:8000: current setup advertises that endpoint athermes_cli/config.py:3957-3960, andget_honcho_client()deliberately handles loopback endpoints atplugins/memory/honcho/client.py:874-887. - The environment fallback is not the only endpoint source on current main.
plugins/memory/honcho/client.py:454-458reads Honcho JSON and:841-850readshoncho.base_url; both later reach the SDK at:908-913.
Suggested changes
- First correct the indentation. Then re-scope the protection so it preserves documented local/self-hosted deployments, and apply any adopted guard after endpoint resolution rather than only to
HONCHO_BASE_URL.
Automated hermes-sweeper review.
| resolved_host = host or resolve_active_host() | ||
| api_key = os.environ.get("HONCHO_API_KEY") | ||
| base_url = os.environ.get("HONCHO_BASE_URL", "").strip() or None | ||
| if base_url: |
Contributor
There was a problem hiding this comment.
This line has six leading spaces while the surrounding method body has eight, so the patch raises an indentation error on import. Please align it with base_url and return cls.
1 task
This was referenced Jul 28, 2026
zapabob
added a commit
to zapabob/hermes-agent
that referenced
this pull request
Aug 20, 2026
## Summary - Teach `_resolve_base_url` to fall back when config/env points at always-blocked hosts. - Preserve localhost / LAN self-host support while blocking metadata SSRF springboards. - Add focused unit tests. ## Salvage / credit Same class as RetainDB always-blocked floor; avoids the over-broad private-IP rejection pattern from NousResearch#4984 / NousResearch#4986.
zapabob
added a commit
to zapabob/hermes-agent
that referenced
this pull request
Aug 22, 2026
## Summary - Teach `_resolve_base_url` to fall back when config/env points at always-blocked hosts. - Preserve localhost / LAN self-host support while blocking metadata SSRF springboards. - Add focused unit tests. ## Salvage / credit Same class as RetainDB always-blocked floor; avoids the over-broad private-IP rejection pattern from NousResearch#4984 / NousResearch#4986.
zapabob
added a commit
to zapabob/hermes-agent
that referenced
this pull request
Aug 22, 2026
## Summary - Teach `_resolve_base_url` to fall back when config/env points at always-blocked hosts. - Preserve localhost / LAN self-host support while blocking metadata SSRF springboards. - Add focused unit tests. ## Salvage / credit Same class as RetainDB always-blocked floor; avoids the over-broad private-IP rejection pattern from NousResearch#4984 / NousResearch#4986.
zapabob
added a commit
to zapabob/hermes-agent
that referenced
this pull request
Aug 23, 2026
## Summary - Teach `_resolve_base_url` to fall back when config/env points at always-blocked hosts. - Preserve localhost / LAN self-host support while blocking metadata SSRF springboards. - Add focused unit tests. ## Salvage / credit Same class as RetainDB always-blocked floor; avoids the over-broad private-IP rejection pattern from NousResearch#4984 / NousResearch#4986.
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.
What does this PR do?
The Honcho memory plugin reads
HONCHO_BASE_URLfrom an environmentvariable and passes it directly to the Honcho client without validation.
If
HONCHO_BASE_URLis set to an internal address (e.g.http://169.254.169.254on AWS,http://metadata.google.internalon GCP,or any private network service), every memory read and write would silently
make requests to that internal address — a classic SSRF attack vector.
Fix
Added an
is_safe_url()check after readingHONCHO_BASE_URL. If theURL resolves to a private/internal address, it is ignored with a warning
log and the plugin falls back to API-key-only mode.
This is consistent with the SSRF protection already applied in:
tools/homeassistant_tool.py(HASS_URL)plugins/memory/retaindb/__init__.py(RETAINDB_BASE_URL)tools/web_tools.pyType of Change
Checklist