Skip to content

Commit 43c7ac8

Browse files
committed
security: fix 3 HIGH + 3 MEDIUM findings from red team review
- H-1: guard negative abs_off in obj_bytes() (buffer read bypass) - H-2: remove CERT_NONE from ZapClient TLS (MITM protection) - H-3: add MAX_MESSAGE_SIZE check in ZapServer (OOM DoS) - M-5: log exceptions instead of bare pass in server - L-1: validate ZAP version in Message.parse() - L-2: wrap req_id at u32 boundary in CloudClient
1 parent faef4b6 commit 43c7ac8

25 files changed

+4004
-262
lines changed

pkg/hanzo-mcp/hanzo_mcp/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ def override(obj): # type: ignore
3535
__version__ = _get_version("hanzo-mcp")
3636
except Exception:
3737
__version__ = "0.10.24" # fallback
38+
39+
# Re-export canonical types from hanzoai core.
40+
# hanzo-mcp works standalone but prefers hanzoai when available.
41+
try:
42+
from hanzoai.protocols import PermissionPolicy, PermissionMode, PermissionOutcome
43+
from hanzoai.config import ConfigLoader, RuntimeConfig
44+
from hanzoai.session import Session, compact_session, CompactionConfig
45+
from hanzoai.mcp import normalize_mcp_name, mcp_tool_name, MCPClient
46+
except ImportError:
47+
pass # hanzoai not installed, MCP server still works standalone

pkg/hanzo-mcp/hanzo_mcp/cli_enhanced.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ def create_parser() -> argparse.ArgumentParser:
2525
Use --list-tools to see all available tools and their current status.
2626
2727
Configuration Files:
28-
Global: ~/.config/hanzo/mcp-settings.json
29-
Project: ./.hanzo-mcp.json or ./.hanzo/mcp-settings.json
28+
User: ~/.hanzo/settings.json
29+
Project: .hanzo/settings.json
30+
Local: .hanzo/settings.local.json
3031
3132
Examples:
3233
# Start server with only read tools

pkg/hanzo-mcp/hanzo_mcp/config.py

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)