MCP07
- Location
plugin/__init__.py:95- Finding
Owner Investment Ledger Injected into Group Sessions Without Audience Authorization ## Remediation Suggestions 1. **Disable automatic digest injection by default.** Require explicit owner opt-in before exposing financial context to the host model. 2. **Authorize before fetching data.** Validate a trusted sender identity, session ownership, and session audience before calling `_brief_text`. 3. **Fail closed for shared or unidentified audiences.** Exclude group, shared, and unknown sessions unless the owner has explicitly authorized that particular audience. 4. **Separate authorization from duplicate suppression.** Continue using session identifiers for deduplication only; bind any authorization decision to trusted owner and audience metadata. 5. **Minimize injected content.** For unauthorized or unrelated sessions, provide no ledger details. If needed, expose only a generic notice that an investment capability exists. 6. **Apply equivalent controls to investment tools.** Prevent non-owner callers from retrieving the same information through tools after digest injection is disabled. 7. **Add regression tests.** Verify that owner-private sessions receive only authorized context, while group, non-owner, unknown-platform, and missing-identity sessions receive none. Test that changes to the cached digest cannot bypass these checks.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/__init__.py, lines 95–110; enabled by default through registration at lines 122–136.
Vulnerability Type: Missing audience authorization leading to sensitive-context disclosure.
Risk Level: Medium.
Affected Integration: The bundled Hermes adapter. The supplied OpenClaw manifest does not establish that OpenClaw executes this Python registrar.Complete Code Snippet
The hook excludes only subagent and cron platforms:
python SKIP_PLATFORMS = {"subagent", "cron"}The complete callback factory injects the digest without validating the session audience:
python def _make_pre_llm_call(invest_home): def pre_llm_call(session_id=None, platform=None, **_): if platform in SKIP_PLATFORMS: return None text = _brief_text(invest_home) if not text: return None if session_id is None: # Hermes always passes one; without it there is nothing to dedupe on return {"context": text} if _last_injected.get(session_id) == text: return None if len(_last_injected) > 1000: # ponytail: long-lived gateway, bound the map instead of tracking session ends _last_injected.clear() _last_injected[session_id] = text return {"context": text} return pre_llm_callThe registration defaults to enabling digest injection:
python invest_home, inject_digest = None, True if hasattr(ctx, "get_config"): try: invest_home = ctx.get_config("invest_home") # `hermes config set ... false` may store the string "false" inject_digest = str(ctx.get_config("inject_digest", True)).strip().lower() not in ("false", "0", "no", "off") except Exception: # noqa: BLE001 config read must never break plugin load invest_home = None if hasattr(ctx, "register_system_prompt_section"): try: ctx.register_system_prompt_section("openinvest.routing", ROUTING_RULE) ...[truncated 3191 chars]
