- Location
- openclaw-tools.ts:163
- Finding
- Paid Agent Tools Lack Authorization Enforcement at the OpenClaw Adapter Boundary<![CDATA[
## Vulnerability Details
**File Location**: `openclaw-tools.ts:163-196, 203-235`
**Vulnerability Type**: Missing local authorization and validation for economic operations
**Risk Level**: Medium
### Vulnerable Code
```ts
export function createRequestTool(toolCtx: OpenClawToolContext): AgentTool {
return {
name: 'agentbnb-request',
label: 'AgentBnB Request',
description:
'Request execution of a skill from another agent on the AgentBnB network. Handles credit escrow automatically.',
parameters: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'Search query to find a matching capability (auto-request mode)',
},
card_id: {
type: 'string',
description: 'Direct card ID to request (skips search)',
},
skill_id: {
type: 'string',
description: 'Specific skill within a v2.0 card',
},
params: {
type: 'object',
description: 'Input parameters for the capability',
},
max_cost: {
type: 'number',
description: 'Maximum credits to spend (default: 50)',
},
},
required: [],
},
async execute(_toolCallId, params) {
const ctx = buildMcpContext(toolCtx);
const result = await handleRequest(params, ctx);
return toAgentToolResult(result);
},
};
}
```
```ts
export function createConductTool(toolCtx: OpenClawToolContext): AgentTool {
return {
name: 'agentbnb-conduct',
description:
'Orchestrate a complex task across multiple agents on the AgentBnB network. Decomposes the task, matches sub-tasks to agents, and executes the pipeline.',
parameters: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'Natural language task description',
},
plan_only: {
type: 'boolean',
description: 'If true, ret
...[truncated 2491 chars]
- Remediation
- <![CDATA[
## Remediation Suggestions
- Require either a validated `query` or a complete `card_id` and `skill_id` combination.
- Require an explicit positive `max_cost` or `max_budget`; do not use implicit spending defaults.
- Enforce strict upper bounds at the adapter boundary.
- Require a short-lived owner approval token bound to the target, parameters, and exact maximum cost.
- Separate planning and execution into different tools, with execution requiring confirmation.
- Display the selected provider, data being transmitted, price, and trust information before authorization.
- Rate-limit paid operations and prevent recursive or repeated agent-triggered purchases.
- Add tests proving that missing authorization, missing targets, invalid costs, and exceeded budgets are rejected before handler invocation.
]]>