In-app reader
PraisonAI's MCP HTTP Stream transport uses an unsafe prefix match when validating the Origin header. The default localhost allowlist includes origins such as http://localhost, and the validation accepts any origin that starts with an allowed value.
As a result, an attacker-controlled origin such as http://localhost.evil.example passes the localhost origin check.
When the MCP HTTP Stream server is started without an API key, which is the CLI default, this allows a malicious webpage to trigger unauthenticated MCP tools/call requests against a locally running PraisonAI MCP server.
This is best framed as a browser-mediated localhost attack / DNS-rebinding-style Origin validation bypass. The default server binds to 127.0.0.1, so this is not a directly internet-facing unauthenticated API in the default configuration.
Relevant source locations:
src/praisonai/praisonai/mcp_server/cli.py
src/praisonai/praisonai/mcp_server/transports/http_stream.py
src/praisonai/praisonai/mcp_server/server.py
src/praisonai/praisonai/mcp_server/adapters/__init__.py
src/praisonai/praisonai/mcp_server/adapters/extended_capabilities.py
src/praisonai/praisonai/mcp_server/adapters/cli_tools.py
src/praisonai/praisonai/capabilities/files.py
The MCP CLI defaults to HTTP host 127.0.0.1, API key None, and allowed origins None unless explicitly configured:
parser.add_argument("--host", default="127.0.0.1")
parser.add_argument("--port", type=int, default=8080)
parser.add_argument("--api-key", default=None)
parser.add_argument("--allowed-origins", default=None, help="Comma-separated allowed origins for security")
Discussion
Sign in to join the discussion.
Keep reading
Optional: create a free account to save items, track programs, and sync across web + app. Reading stays free.