Back to skill

Security audit

Random Team Picker

Security checks for vulnerabilities and agentic risk

Overview

This is a simple local random team picker with one bounded-risk reliability issue in weighted selection, but no hidden access, persistence, or data exfiltration behavior.

This skill is appropriate for simple local team selection. Avoid passing untrusted or extremely large weight values until the weighted-selection code validates weight size or uses a non-expanding sampling approach.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pick.py:11
Finding

Unbounded Weighted-Selection Expansion Allows Memory Exhaustion

Content
View full analysis

Vulnerability Details

File Location: scripts/pick.py, lines 11–14
Vulnerability Type: Uncontrolled memory allocation through attacker-controlled weights
Risk Level: Medium

Vulnerable Code

python
weight_map = dict(w.split(':') for w in weights.split(','))
for m in pool:
    w = int(weight_map.get(m, 1))
    weight_list.extend([m] * w)
return random.sample(weight_list, min(count, len(pool)))

Technical Analysis

The --weighted argument is parsed into integer weights without validating their range. Each weight is then represented by duplicating the corresponding member name in weight_list.

Memory consumption is therefore proportional to the sum of user-supplied weights rather than the number of members. An attacker who can invoke the skill can provide an extremely large positive integer, causing Python to attempt a correspondingly large allocation. This may stall the process, raise MemoryError, or trigger operating-system termination.

Attack Path

  1. The attacker invokes the skill with at least one member and an excessively large weight, for example:
    bash
    python3 scripts/pick.py --from "Alice" --weighted "Alice:1000000000"
    
  2. int() accepts the large value.
  3. [m] * w attempts to construct a list containing one billion references.
  4. weight_list.extend(...) consumes excessive process and system memory.
  5. The skill or its hosting agent may become unresponsive or terminate.

Impact Assessment

Exploitation does not grant additional privileges, code execution, or data access. Its impact is availability loss within the privileges of the invoking process. It can terminate or degrade the skill, the hosting agent, and potentially other workloads on the same resource-constrained host.

Remediation
View remediation

Remediation Suggestions

  • Parse weights with explicit exception handling and reject malformed values.
  • Require every weight to be a positive integer within a conservative maximum.
  • Limit the number of members and the aggregate accepted weight.
  • Avoid materializing repeated entries. Use a bounded weighted-selection algorithm based on cumulative weights or random.choices().
  • If selections must be unique, implement weighted sampling without replacement rather than sampling duplicated list entries.
  • Add tests covering zero, negative, malformed, and extremely large weights.
  • Run the skill with appropriate memory and execution-time limits as defense in depth.

Example validation pattern:

python
MAX_WEIGHT = 10_000

try:
    weight = int(weight_map.get(member, 1))
except ValueError:
    raise ValueError(f"Invalid weight for {member}")

if not 1 <= weight <= MAX_WEIGHT:
    raise ValueError(f"Weight for {member} must be between 1 and {MAX_WEIGHT}")
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file contains a Chinese disclaimer line alongside otherwise English documentation, but it does not explain that the skill is region-specific or offer language/locale selection. Per the policy, locale-specific language constraints should be justified or optional rather than imposed implicitly.

Content

No source excerpt is available for this finding.