Back to skill

Security audit

Competitor Analyzer

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but its shell script has a real input-handling flaw that can let a crafted company name run local Python code.

Review before installing or running. Use only trusted company names or URLs, do not paste untrusted strings into analyze.sh, and avoid confidential targets because searches are sent to DuckDuckGo. The script should be fixed to pass the query to Python as an argument instead of interpolating it into Python source.

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
analyze.sh:20
Finding

Arbitrary Python Code Execution Through Unsanitized Company Input

Content
View full analysis
/dev/null | \ python3 -c " import sys, re, html content = sys.stdin.read() results = re.findall(r'class=\"result__snippet\">(.*?)', content, re.DOTALL) for i, r in enumerate(results[:5]): text = html.unescape(re.sub(r'<[^>]+>', '', r)).strip() if text: print(f'- {text}') " 2>/dev/null || echo "- (search unavailable — run with an AI agent for better results)" } ``` ### Technical Analysis The `query` variable contains data derived from the user-controlled command-line argument. Line 20 interpolates that value directly into Python source code: ```bash python3 -c "import urllib.parse; print(urllib.parse.quote('$query'))" ``` Although the shell variable is inside shell double quotes, its value is inserted into a single-quoted Python string. Shell quoting does not protect the resulting Python program. An attacker can include a single quote and Python syntax in the company argument to terminate the intended string and add arbitrary statements. For example, an argument shaped like the following can inject an operating-system command: ```text x')); __import__("os").system("touch pwned"); # ``` When incorporated into the generated Python source, the injected statement executes under the privileges of the user running the skill. The trailing Python comment suppresses the legitimate query suffix and remaining syntax. ### Attack Path 1. An attacker supplies a crafted company name to `analyze.sh`. 2. The value is assigned to `COMPANY`. 3. `SEARCH_NAME` removes URL-related components but does not reject Python metacharacters, quotes, semicol ...[truncated 1137 chars]
Remediation
View remediation
/dev/null | python3 -c ' import sys, re, html content = sys.stdin.read() results = re.findall(r"class=\"result__snippet\">(.*?)", content, re.DOTALL) for result in results[:5]: text = html.unescape(re.sub(r"<[^>]+>", "", result)).strip() if text: print(f"- {text}") ' 2>/dev/null || echo "- (search unavailable — run with an AI agent for better results)" } ``` Additional hardening measures: 1. Treat all command-line arguments as untrusted data. 2. Never construct source code by concatenating or interpolating user input. 3. Add regression tests containing single quotes, double quotes, semicolons, newlines, backticks, shell substitutions, and Python comment characters. 4. Verify that malicious-looking inputs are URL-encoded as plain data and never executed. 5. Consider implementing URL encoding entirely in one language or using a dedicated command-line encoder to reduce nested quoting complexity. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script transmits the user-supplied company name or URL to DuckDuckGo in live network requests, and it does so without any notice, consent prompt, or documentation warning about third-party data disclosure. This can leak sensitive or internal targets a user is researching, especially if the input contains confidential customer names, stealth projects, or non-public URLs.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.