T05 · Unauthorized Access and Privilege Escalation
- Location
core/openclaw_adapter.py:194- Finding
Spawned-agent tool restrictions are declared but not enforced
- Content
View full analysis
Vulnerability Details
File Location:
core/openclaw_adapter.py:194-205
Additional Location:core/four_tuple.py:145-148
Vulnerability Type: Failure to enforce least-privilege tool restrictions
Risk Level: HighEvidence
python params = { "task": task, "mode": "run", # 一次性执行 "timeoutSeconds": phi.timeout, } # 模型(使用指定的或默认的) model = phi.model if phi.model != "default" else self.default_model params["model"] = model # 标签 if phi.role: params["label"] = f"{phi.role} [model: {model}]"The alternative parameter builder has the same issue:
python params = { "task": task, "model": self.model, }Technical Analysis
AgentTuple.toolsis presented as an explicit capability subset for a spawned agent. For example, a researcher is assigned onlyweb_searchandweb_fetch, while a coder may receive file and command-execution tools.Neither spawn-parameter builder includes this tool allowlist in the request sent to
sessions_spawn. Consequently, the declared restriction is descriptive rather than enforceable. If the external OpenClaw runtime grants a default set of tools, a child agent may receive capabilities such as file writing or command execution even though its tuple appears to restrict it to web research.This exceeds the minimum privileges required for research and analysis tasks. The issue is compounded by
router/tool_router.py, where safe mode defaults to disabled.Attack Path
- An attacker supplies a crafted task, or malicious instructions enter the workflow through fetched content.
- The orchestrator creates an
AgentTuplethat appears to contain a limited tool set. OpenClawAdapter._build_spawn_params()omitsphi.tools.- The injected
sessions_spawnimplementation creates the child agent using runtime-default tools. - If those defaults include privileged tools, the child agent can be induced to read or modify files, execute commands, or invoke other t ...[truncated 735 chars]
- Remediation
View remediation
Remediation Suggestions
- Include an explicit tool allowlist in every spawn request using the exact parameter supported by the OpenClaw runtime.
- Reject spawning when the runtime cannot guarantee enforcement of the requested tool restrictions.
- Validate every tool name against a fixed local allowlist before dispatch.
- Enable safe mode by default and require explicit approval before granting
exec,process,write, oredit. - Define role-specific maximum privileges, such as web-only access for researchers and read-only access for analysts.
- Ensure an empty tool list means “no tools,” not “use runtime defaults.”
- Add integration tests that verify a web-only child agent cannot invoke file, process, browser, or messaging tools.
- Log the effective tool set returned by the runtime and fail closed if it differs from the requested set.
