Back to skill

Security audit

Arya Model Router

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent local model router, but its documented shell invocation can be unsafe if an agent inserts user messages into a shell command.

Review the integration code before installing or using this skill. Call router.py with an argument-vector API or stdin, not by building a shell command containing raw user text. Also confirm you are comfortable with auto-routing to stronger models/subagents and with the local state.json feedback/history file.

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

Error
Location
README.md:39
Finding

Shell Command Injection Through Documented User-Message Interpolation

Content
View full analysis

Vulnerability Details

File Location: README.md, line 39
Vulnerability Type: Shell command injection in documented integration guidance
Risk Level: High

Vulnerable Code Snippet:

bash
python3 skills/arya-model-router/router.py --text "<user message>" --context-chars 65000

Technical Analysis

The integration example instructs an agent or developer to place an untrusted user message directly inside a shell command. Double quotes do not neutralize all shell syntax. In common shells, command substitutions such as $(command) and backticks are evaluated even when they appear inside double quotes. Embedded quotation marks may also terminate the intended argument and introduce additional shell operators.

The Python script itself uses argparse and does not invoke a shell. The vulnerability arises if an integrating agent follows the documented pattern by constructing a command string and executing it through a shell. Exploitability therefore depends on the integration using shell interpretation rather than a direct argument-vector API.

Attack Path

  1. An attacker supplies a message containing shell metacharacters or command substitution, such as $(attacker_command).
  2. An integrating agent replaces <user message> with that input in the documented command.
  3. The integration submits the resulting command string to a shell.
  4. The shell evaluates the injected syntax before router.py starts.
  5. The injected command executes with the operating-system privileges of the agent or integration process.

Impact Assessment

Successful exploitation permits arbitrary command execution under the account running the integration. Depending on that account's permissions, an attacker could read or modify accessible files, obtain environment variables or credentials, destroy data, tamper with routing state or configuration, invoke network utilities, or use the compromised process as a footho ...[truncated 299 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not construct a shell command by concatenating or interpolating user-controlled text.

  • Invoke the script with an argument vector and disable shell interpretation:

    python
    subprocess.run(
        [
            "python3",
            "skills/arya-model-router/router.py",
            "--text",
            user_message,
            "--context-chars",
            "65000",
        ],
        shell=False,
        check=True,
    )
    
  • Prefer a native Python function call when the router and integration run in the same application.

  • Alternatively, redesign the interface to accept the message through standard input while keeping fixed command-line arguments.

  • Update README.md to explicitly prohibit shell=True, os.system, and equivalent shell-string execution with untrusted input.

  • If a shell is unavoidable, apply platform-specific escaping through a well-tested library. Treat escaping as a secondary control rather than a substitute for argument-vector execution.

  • Run the integration under a least-privileged account with restricted filesystem, credential, and network access to reduce impact if another injection flaw occurs.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · router.py (reported line 89)May include surrounding context.

python
th['heavy_score'] = heavy
    th['default_score'] = default
    rules['thresholds'] = th
    return rules


def score_text(text: str, rules: dict):

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README includes Spanish-specific command variants (caro, debil) and a Spanish example (resume esto) as built-in interaction patterns, but it does not state that the skill is bilingual, locale-specific, or user-selectable. This can violate language/locale policy because it implicitly steers usage toward a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

Scanner excerpt · README.md (reported line 61)May include surrounding context.

md
## Notes

- This router is safe: it does not execute arbitrary commands or call external services.
- It only emits decisions.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description is written in Spanish and presents behavior in that language without indicating language negotiation or user opt-in, which can lead to mismatches between user intent and skill behavior. While not directly enabling code execution or privilege abuse, forced language assumptions can impair informed consent, cause misunderstanding of routing/escalation behavior, and increase operational mistakes in a security-sensitive workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example "Router: analiza esto" is vague and does not define clear invocation boundaries, which can cause the skill to activate or be interpreted in situations the user did not explicitly intend. In a routing skill that can escalate work to stronger models or sub-agents, ambiguous triggering increases the risk of unintended model selection, extra cost, and accidental forwarding of sensitive context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains multiple natural-language output strings in Spanish, such as reason messages and routing explanations, and there is no indication that the user can choose the language. That can violate a language/locale policy when a skill imposes a specific language by default without opt-in or documented regional scope.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.