Back to skill

Security audit

Web Search

Security checks for vulnerabilities and agentic risk

Overview

This web-search skill is coherent and disclosed, with normal risks from web lookups, local result files, and an unpinned Python dependency.

Install dependencies in an isolated environment, verify the intended DuckDuckGo package before installing, and save outputs only to non-sensitive workspace paths. Treat saved search results as untrusted web content and do not execute or automatically import them.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:22
Finding
Unpinned and Inconsistent Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md:22-24`; `scripts/search.py:17-22` **Vulnerability Type**: Unpinned third-party dependency and inconsistent package naming **Risk Level**: Medium ### Vulnerable Code `SKILL.md:22-24`: ```markdown Install the required dependency: ```bash pip install duckduckgo-search ``` ``` `scripts/search.py:17-22`: ```python try: from ddgs import DDGS except ImportError as e: print(f"Error: Missing required dependency: {e}", file=sys.stderr) print("Install with: pip install ddgs", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis The project instructs users to install a third-party package directly from the configured Python package index without specifying an exact version, cryptographic hashes, or a lock file. Consequently, the code that will ultimately be imported is not fixed to the version reviewed with this skill. The installation guidance is also inconsistent: `SKILL.md` directs users to install `duckduckgo-search`, while the script imports the `ddgs` module and recommends installing the separate `ddgs` package when the import fails. This ambiguity makes dependency provenance harder to verify and may cause users or automated agents to install more than one package while troubleshooting. Neither package is proven malicious by the audited material. The security issue is that a future compromised release, package-index compromise, or dependency-account takeover could change the effective code executed by the skill without any modification to this repository. A source distribution may also execute build-backend code during installation, while an installed malicious release can execute code when `from ddgs import DDGS` is evaluated. ### Attack Path 1. An attacker compromises the maintainer account, release pipeline, or package-index distribution path for an instructed dependency. 2. The attacker publishes a malicious release under the d ...[truncated 1159 chars]
Remediation
## Remediation Suggestions 1. Choose one canonical dependency whose package name and import interface are verified, and use that name consistently in both `SKILL.md` and `scripts/search.py`. 2. Pin the dependency to a reviewed exact version, for example through a requirements file using `package==x.y.z`. 3. Generate and enforce cryptographic hashes, such as with a hash-locked requirements file and `pip install --require-hashes -r requirements.txt`. 4. Commit the dependency manifest and lock data to the project so the reviewed dependency set is reproducible. 5. Review transitive dependencies and refresh pins through a controlled update process with security testing. 6. Install dependencies inside an isolated virtual environment or container using a non-privileged account. 7. Avoid presenting package-install commands dynamically in exception messages. Instead, refer users to the repository's reviewed, hash-locked installation procedure. 8. Add automated checks that reject unpinned dependencies and ensure the documented package provides the imported `ddgs` module.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Lp3

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding
The skill documents the ability to write arbitrary search results to local files via `--output`, but the manifest declares no explicit tool scope or permission boundaries. In an agent setting, undocumented file-write capability can lead to unsafe writes, overwriting existing files, or persistence of untrusted web content without user awareness.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The top-level description is broad enough to match many generic information-seeking requests, which can cause the skill to be invoked for routine prompts beyond a narrowly defined scope. Over-broad activation increases the attack surface by making network access and optional file output more likely to occur when a simpler, non-tool response would suffice.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The 'When to Use This Skill' section lists many positive triggers but provides no activation boundaries or negative examples, making accidental or excessive invocation more likely. In practice, that can expose users to unnecessary external lookups, retrieval of untrusted content, and downstream file writes when the task could be handled locally.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documentation encourages saving results to arbitrary file paths but does not warn about overwrite risks, path safety, or the fact that web-derived content is untrusted. In an agent workflow, this can lead to clobbering user files, depositing attacker-controlled content into sensitive locations, or creating misleading artifacts that appear locally trusted.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The script accepts an arbitrary --output path and writes search results to that local file, including creating parent directories. That behavior exceeds the stated skill purpose of performing web search and returning formatted results, and in an agent environment it can be abused to overwrite or plant files in unintended locations if the caller can influence the path.

Static analysis

No suspicious patterns detected.