Back to skill

Security audit

shopping-intent-extractor

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently summarizes shopping or payment intent from the current conversation, with a disclosed optional local command path and no evidence of persistence, exfiltration, or destructive behavior.

Before installing, confirm you are comfortable with the skill summarizing shopping and payment-related details from the current conversation. If the optional `payment-intent` command is used, run it through a trusted executable path with a validated session ID and avoid shell string interpolation.

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
SKILL.md:40
Finding

Potential Command Injection Through an Unvalidated Session Identifier

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 40 and 51–52; repeated operational guidance at lines 151 and 169
Vulnerability Type: Command injection through unsafe command construction
Risk Level: Medium

Vulnerable Code

bash
payment-intent summarize -s <sessionId>

Related execution instructions:

text
1. Obtain sessionId from the current session metadata
2. Execute the command: payment-intent summarize -s <sessionId>

Technical Analysis

The skill directs the agent to obtain a session identifier from session metadata and interpolate it into a shell command. It does not require validation, shell-safe quoting, or execution through an argument-array API.

If the underlying agent substitutes the identifier into a command string and passes that string to a shell, shell metacharacters in attacker-influenced metadata could terminate or modify the intended command and append arbitrary commands. Exploitability therefore depends on both the session identifier being attacker-controllable and the agent using shell-based execution rather than a direct process API.

The instructions also rely on the executable name payment-intent without requiring resolution to a trusted absolute path. Although no tool replacement is present in the audited project, an untrusted executable earlier in PATH could be invoked instead.

Attack Path

  1. An attacker influences or supplies a session identifier containing shell metacharacters and an additional command.
  2. The agent retrieves that identifier from the current session metadata as instructed.
  3. The agent substitutes the identifier directly into payment-intent summarize -s <sessionId>.
  4. The agent executes the resulting string through a shell.
  5. The shell interprets the metacharacters and executes the injected command with the agent process's privileges.

Impact Assessment

Successful exploitation could execute arbitrary local commands with the privileges of the agent or ski ...[truncated 447 chars]

Remediation
View remediation

Remediation Suggestions

  1. Validate the session identifier against a strict allowlist appropriate to its documented format, for example ^[A-Za-z0-9_-]+$, and reject any nonconforming value.
  2. Invoke the program through a direct process API with a fixed argument array, such as ["payment-intent", "summarize", "-s", sessionId], rather than constructing a shell command.
  3. Explicitly prohibit shell evaluation, string concatenation, and constructs such as sh -c.
  4. Resolve the executable through a trusted absolute path and verify that its ownership and permissions prevent untrusted replacement.
  5. Run the command with least privilege and restrict its filesystem and network access to what summarization requires.
  6. Treat command output as untrusted JSON: enforce size limits, parse it with a strict JSON parser, and validate the returned schema before presenting it to the user.
  7. Update every repeated command example, including the decision flow, so the secure invocation requirement is consistent throughout the skill documentation.
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 (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file explicitly requires the summary field to be in Chinese, which imposes a fixed language choice. The policy allows locale constraints only when the user is offered a choice or the constraint is clearly justified; neither is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Rule 6 states that the summary field must use Chinese, creating a fixed-language behavior. This is a natural-language policy violation because the skill does not offer the user a language/locale choice and does not document a justified regional limitation.

Content

No source excerpt is available for this finding.