T09 · Insecure Skill Coding Practices
- Location
handler.ts:94- Finding
Unenforced Log Input Limit Enables Resource Exhaustion
- Content
View full analysis
Vulnerability Details
File Location:
handler.ts:94-97(validation flaw), with the unenforced limit declared athandler.ts:292-294
Vulnerability Type: Unbounded input processing / denial of service
Risk Level: MediumVulnerable Code
ts if ((input.action === 'analyze' || input.action === 'evolve') && (!input.logs || !Array.isArray(input.logs) || input.logs.length === 0)) { errors.push('"logs" array is required for analyze/evolve actions'); }The status response advertises a limit that is not enforced:
ts limits: { max_logs_per_request: 10000, max_patterns_returned: 50, max_recommendations: 20, },Technical Analysis
Request validation only verifies that
logsis a non-empty array. It does not reject arrays exceeding the declared 10,000-entry maximum, limit the byte size of the request, constrain individual string fields, or validate each log entry's structure.The accepted array is subsequently processed through multiple full-array scans, filtering operations, maps, sets, sorting, and string generation. The
evolveaction invokes the same analysis and performs additional processing. Consequently, an attacker-controlled oversized array—or entries containing extremely largemessage,context,timestamp, orstackstrings—can cause disproportionate CPU and memory consumption.This violates the implementation's own documented limit and leaves availability dependent on limits imposed by the surrounding runtime.
Attack Path
- An attacker or untrusted caller invokes the Skill using the
analyzeorevolveaction. - The attacker supplies a non-empty
logsarray containing substantially more than 10,000 entries, or supplies entries with very large string fields. validateRequestaccepts the payload because it imposes no upper bound.handleAnalyzerepeatedly traverses and aggregates the attacker-controlled data;evolveadds ...[truncated 703 chars]
- An attacker or untrusted caller invokes the Skill using the
- Remediation
View remediation
Remediation Suggestions
-
Enforce the declared maximum during validation:
ts const MAX_LOGS = 10_000; if ( (input.action === 'analyze' || input.action === 'evolve') && (!Array.isArray(input.logs) || input.logs.length === 0 || input.logs.length > MAX_LOGS) ) { errors.push(`"logs" must contain between 1 and ${MAX_LOGS} entries`); } -
Validate every log entry, including allowed severity values, timestamp format, and required string fields.
-
Apply explicit length limits to
message,context,timestamp, andstack. Reject the request rather than silently accepting exceptionally large values. -
Enforce a maximum serialized request-body size at the OpenClaw or HTTP host boundary before parsing the full payload.
-
Configure runtime memory, execution-time, concurrency, and per-caller rate limits to contain resource-exhaustion attempts.
-
Add tests confirming rejection of arrays above 10,000 entries, oversized strings, malformed entries, sparse arrays, and payloads near the configured byte-size boundary.
-
