Skip to content

fix(security): validate HONCHO_BASE_URL against SSRF before requests#4986

Open
maymuneth wants to merge 1 commit into
NousResearch:mainfrom
maymuneth:fix/honcho-ssrf-base-url-validation
Open

fix(security): validate HONCHO_BASE_URL against SSRF before requests#4986
maymuneth wants to merge 1 commit into
NousResearch:mainfrom
maymuneth:fix/honcho-ssrf-base-url-validation

Conversation

@maymuneth

Copy link
Copy Markdown
Contributor

What does this PR do?

The Honcho memory plugin reads HONCHO_BASE_URL from an environment
variable and passes it directly to the Honcho client without validation.

If HONCHO_BASE_URL is set to an internal address (e.g.
http://169.254.169.254 on AWS, http://metadata.google.internal on 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 reading HONCHO_BASE_URL. If the
URL 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.py

Type of Change

  • 🔒 Security fix (SSRF)

Checklist

  • Read the Contributing Guide
  • Commit messages follow Conventional Commits
  • Consistent with existing SSRF protection pattern in Hermes
  • No behavior change for legitimate Honcho endpoints
  • ImportError handled gracefully

@alt-glitch alt-glitch added type/security Security vulnerability or hardening P2 Medium — degraded but workaround exists comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels May 1, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #4984 (same SSRF validation pattern for RetainDB plugin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists tool/memory Memory tool and memory providers type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants