T09 · Insecure Skill Coding Practices
- Location
SKILL.md:95- Finding
Unauthenticated Distributed Results Can Poison Map-Reduce Aggregation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 95–99
Vulnerability Type: Untrusted message processing and insufficient result validation
Risk Level: MediumVulnerable Code
bash MAP_RESULTS=$(pilotctl --json received \ | jq '[.messages[] | select(.payload.type == "map_result")]') FINAL=$(echo "$MAP_RESULTS" | jq 'map({(.payload.word): .payload.count}) | add') echo "$FINAL"Technical Analysis
The workflow accepts every received message whose self-declared payload type is
map_result. It does not verify the currentjob_id, authenticate the sender, confirm that the sender belongs to the assigned mapper set, reject duplicate submissions, or validate the payload schema and size.Because the message type is controlled by the sender, an unauthorized or compromised peer can submit a forged result that passes the filter. The forged
wordandcountfields are then incorporated directly into the final aggregation. Duplicate keys may also overwrite or otherwise interfere with legitimate results according to the aggregation behavior.Attack Path
- An attacker gains the ability to send messages to the receiving agent, such as through a malicious, compromised, or unauthorized peer.
- The attacker sends a message with
.payload.typeset tomap_result. - The attacker supplies arbitrary
.payload.wordand.payload.countvalues. - The type-only
jqfilter accepts the forged message. - The forged values are included in
FINAL, poisoning the output. An oversized payload could additionally consume excessive memory or processing time.
Impact Assessment
The attacker does not obtain additional operating-system privileges from this flaw. However, within the distributed job's scope, the attacker can corrupt computed results, introduce cross-job data, cause legitimate values to be replaced or misrepresented, and potentially trigger resource exhaustion with excessively large ...[truncated 26 chars]
- Remediation
View remediation
Remediation Suggestions
- Filter every result by the exact current job identifier.
- Authenticate messages and allow only addresses assigned to the current job.
- Maintain an expected-worker set and accept at most one valid result from each worker.
- Validate payload fields against a strict schema, including types, permitted key formats, numeric ranges, and maximum message sizes.
- Reject malformed, duplicate, unauthorized, stale, and cross-job messages.
- Apply bounded input and aggregation limits to prevent memory and CPU exhaustion.
- Prefer protocol-level message authentication or signatures where supported.
