Back to skill

Security audit

Competitor Analyzer

Security checks for vulnerabilities and agentic risk

Overview

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

Review before installing. Use only with company names or URLs you trust until the query encoding is fixed to pass input as data rather than Python source. Expect the skill to contact DuckDuckGo and leave a markdown report in the current directory.

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

User-Controlled Python Code Injection in Search Query Encoding

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-supplied company name or URL. It is interpolated directly into Python source code inside a single-quoted Python string: ```bash python3 -c "import urllib.parse; print(urllib.parse.quote('$query'))" ``` Shell double quotes do not make the expanded value safe for use as Python source code. If `query` contains an apostrophe, it can terminate the Python string literal. An attacker can then append additional Python statements and use a Python comment to suppress the remaining generated source. The sanitization applied while deriving `SEARCH_NAME` only removes URL protocols, path components, and `www.`. It does not escape apostrophes or prevent Python syntax from entering the dynamically constructed program. This is a code-injection vulnerability rather than ordinary shell metacharacter injection: the shell passes one constructed argument to `python3 -c`, and the Python interpreter executes attacker-controlled content embedded in that argument. ### Attack Path 1. An attacker supplies a crafted company name containing an apostrophe, valid Python statements, and a trailing Python comment marker. 2. ...[truncated 1524 chars]
Remediation
View remediation
(.*?)", content, re.DOTALL) for result in results[:5]: text = html.unescape(re.sub(r"<[^>]+>", "", result)).strip() if text: print(f"- {text}") ' } ``` Prefer letting `curl` perform URL encoding directly with `--get` and `--data-urlencode`; in that case, `encoded_query` is unnecessary and should be removed. Additional hardening measures should include: 1. Treat all command-line arguments as untrusted data. 2. Avoid constructing executable source code with shell variable expansion. 3. Add regression tests using company names containing apostrophes, quotes, semicolons, comment characters, Unicode, and shell metacharacters. 4. Use `curl --fail --show-error` so HTTP and transport failures are distinguishable from successful searches. 5. Run the Skill with least privilege and without unnecessary credentials in its environment. 6. Consider validating input length to prevent excessive resource use, while recognizing that validation is not a substitute for safe argument passing. ]]>
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 (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends user-supplied company input to DuckDuckGo as part of multiple outbound searches without clearly warning the operator that their input will be disclosed to a third party. This can expose sensitive internal targets, stealth research topics, or confidential company names to external services and network observers, which is a real privacy and operational security concern in a reconnaissance-style skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script writes a markdown report containing gathered intelligence to a local file without clearly disclosing that persistent storage will occur. In environments handling sensitive research, this can leave unintended artifacts on disk that may be indexed, synced, or later accessed by other users or processes.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.