Back to skill

Security audit

shodan-skills

Security checks for vulnerabilities and agentic risk

Overview

This Shodan skill does what it says: it uses a declared Shodan API key to query Shodan for host, DNS, search, and account information, with no hidden persistence or unrelated local access found.

Install only if you intend to send IPs, domains, search terms, and your Shodan API key to Shodan. Use it only for assets you are authorized to investigate, avoid pasting sensitive internal targets unless approved, keep SHODAN_API_KEY in a secret store, and update the pinned requests dependency before use in proxy-sensitive environments.

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:8
Finding

Outdated Requests Dependency May Disclose Proxy Credentials

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:8-10
Related Usage: scripts/shodan_api.py:22
Vulnerability Type: Outdated third-party dependency with known proxy credential disclosure behavior
Risk Level: Medium

Vulnerable Code

yaml
dependency:
  python:
    - requests==2.28.0

The pinned dependency is imported and used for all Shodan API requests:

python
import requests

Technical Analysis

The project explicitly pins requests==2.28.0, an outdated version affected by CVE-2023-32681. Under certain HTTPS proxy and redirect conditions, vulnerable Requests versions may forward proxy authentication information during a redirected request.

The API client uses Requests for every external operation and retains its default redirect behavior:

python
if method.upper() == "GET":
    response = requests.get(url, params=params, timeout=30)
elif method.upper() == "POST":
    response = requests.post(url, params=params, timeout=30)

Exploitation is conditional: the runtime must use an authenticated HTTPS proxy, and an attacker must be able to influence or compromise the redirect chain. The audit found no evidence that the project deliberately redirects traffic or transmits credentials to an unrelated destination.

Attack Path

  1. The Skill is installed with the pinned requests==2.28.0 dependency.
  2. It runs in an environment configured to use an HTTPS proxy with authentication credentials.
  3. The client sends a Shodan API request through that proxy.
  4. The request encounters a redirect controlled or influenced by an attacker, such as through compromised network or remote infrastructure.
  5. The vulnerable redirect handling behavior may forward sensitive proxy authentication information.
  6. The attacker captures and potentially reuses the disclosed proxy credentials, subject to the credentials' permissions and environmental access controls.

Impac

...[truncated 571 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the requests==2.28.0 pin with a maintained version that includes the fix for CVE-2023-32681. Prefer the latest compatible stable release after compatibility testing.
  2. Regenerate any dependency lock files and verify the resolved dependency graph after upgrading.
  3. Add automated dependency scanning, such as pip-audit, OSV-Scanner, or Dependabot, to CI.
  4. Use hashes and a trusted package index when installing Python dependencies to improve supply-chain integrity.
  5. Review HTTPS proxy configuration and avoid embedding proxy credentials in environment variables or configuration files where possible.
  6. Rotate potentially exposed proxy credentials if this version has previously run in an authenticated HTTPS proxy environment with untrusted redirect paths.
  7. Add tests covering redirects through authenticated proxies and, where redirects are not required, consider explicitly disabling them or validating redirect destinations before following them.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes a Python script that uses both environment secrets and outbound network access, but the manifest does not declare explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it harder for the platform or reviewer to constrain what the skill may access, especially since it relies on SHODAN_API_KEY and sends data to an external service.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger conditions are broad enough to activate on many generic security, DNS, IP-analysis, and asset-discovery requests, which can cause the agent to use this skill in situations the user did not explicitly intend. In this context, over-broad activation is risky because it can route sensitive user-supplied targets and reconnaissance queries to Shodan without clear user consent or boundary checks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill does not clearly warn users that supplied IP addresses, domains, and search queries will be transmitted to the third-party Shodan service. This creates a privacy and data-handling risk because potentially sensitive investigation targets, internal asset names, or user queries may be disclosed externally without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs users to pass the Shodan API key in the URL query string without any warning. Query parameters are commonly exposed through browser history, proxy logs, server logs, analytics, and referrer leakage, so this guidance can lead to credential disclosure even if TLS is used.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api-reference.md (reported line 29)May include surrounding context.

使用方式

API Key 作为查询参数传递:

text
https://api.shodan.io/shodan/host/8.8.8.8?key={YOUR_API_KEY}

API 端点

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Natural-language strings in the module docstring and CLI help are presented exclusively in Chinese, which can impose a specific language on users without offering a choice. Under the stated policy, forcing a language or locale without user opt-in is a policy concern unless the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file performs HTTP requests to the external Shodan API and includes both user-provided parameters and the SHODAN_API_KEY in those requests. While the code has internal docstrings and error handling, it lacks any user-facing warning, confirmation, or explicit disclosure at execution time that input data and credentials will be transmitted to a third-party service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language instructions throughout the skill are presented only in Chinese, with no indication that this is a region-specific skill or that users may choose another language. Under the policy, forcing a specific language without opt-in can be a locale-policy issue unless justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The entire document is written as a Chinese-only reference and does not indicate that the language choice is optional or justified by a region-specific requirement. Under SQP-3, language or locale constraints can be a policy issue when a specific language is imposed without user opt-in or explanation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.