Back to skill

Security audit

Search Intelligence Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed search and OSINT tool, but it includes built-in workflows for finding exposed secrets, admin panels, and personal information without strong safeguards.

Install only if you need an authorized security/OSINT search tool and will run it against assets or investigations you are allowed to assess. Use a trusted HTTPS or local SearXNG instance, assume queries may be visible outside your machine, avoid searching for third-party secrets or personal data without authorization, pin the SearXNG container image, and treat result text returned to agents as untrusted web content.

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
search_dorks_skill/models.py:94
Finding

Untrusted Search Results Are Embedded Directly into LLM Context

Content
View full analysis

Vulnerability Details

File Location: search_dorks_skill/models.py:94-119
Vulnerability Type: Indirect prompt injection through untrusted search content
Risk Level: Medium

Vulnerable Code

python
def to_context(self, max_results: int = 20) -> str:
    """Format results for LLM context window."""
    lines = [
        f"=== Search Report ===",
        f"Query: {self.query}",
        f"Intent: {self.intent.category.value}/{self.intent.subcategory}",
        f"Strategy: {self.strategy.name}",
        f"Results: {len(self.results)} (of {self.total_found} total)",
        f"Engines: {', '.join(self.engines_used)}",
        f"Time: {self.timing_seconds:.2f}s",
        "",
    ]
    for i, r in enumerate(self.results[:max_results], 1):
        lines.append(f"[{i}] {r.title}")
        lines.append(f"    URL: {r.url}")
        lines.append(f"    {r.snippet[:300]}")
        lines.append(f"    Score: {r.relevance:.2f} | Engines: {', '.join(r.engines)}")
        lines.append("")

    if self.suggestions:
        lines.append("Suggested refinements:")
        for s in self.suggestions[:5]:
            lines.append(f"  • {s}")

    return "\n".join(lines)

Technical Analysis

The to_context() method is explicitly intended to create text for insertion into an AI agent's context. It includes search-result titles, URLs, snippets, and suggestions without establishing a trust boundary or identifying these values as untrusted external data.

These fields originate from the SearXNG response and are copied into SearchResult objects by search_dorks_skill/client.py. A search result can therefore contain text designed to resemble system, developer, or tool instructions. Truncating a snippet to 300 characters limits its size but does not neutralize instruction-like content.

No command-execution sink exists in this package, so the injected text is not executed locally by the Python cod ...[truncated 1602 chars]

Remediation
View remediation

Remediation Suggestions

  1. Return search results as structured data rather than concatenating them directly with trusted agent instructions.
  2. Clearly label all titles, URLs, snippets, and suggestions as untrusted external content.
  3. Wrap each field in explicit delimiters and include a trusted instruction outside those delimiters stating that content inside them must never be followed as instructions.
  4. Keep tool-control instructions in a higher-priority system or developer message rather than in the same text block as search data.
  5. Validate response types and impose conservative length limits on every external field.
  6. Normalize control characters and formatting that could blur boundaries between separate results or trusted instructions.
  7. Add defense-in-depth detection for common prompt-injection phrases. Detection should flag or annotate suspicious results rather than being treated as a complete security boundary.
  8. Require confirmation before a host agent performs sensitive actions based on search results.
  9. Restrict consuming agents to least-privilege tools and enforce destination, operation, and argument allowlists independently of model output.
  10. Add tests using malicious titles and snippets to verify that result content remains data and cannot alter tool-selection policy.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

This example directly instructs the tool to search for exposed .env files, which commonly contain API keys, database credentials, and other secrets. In the context of an agent skill, normalizing secret-hunting as a standard workflow materially enables credential discovery and downstream compromise.

Content

Scanner excerpt · SKILL.md (reported line 83)May include surrounding context.

md
# Just describe what you want — the skill handles everything:
# intent detection, dork generation, engine selection, scoring
report = skill.search("find exposed .env files on example.com")

# Print LLM-ready formatted output
print(report.to_context())

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This section expands the credential-hunting pattern by combining exposed .env files with admin panel and directory-listing discovery, which is a classic reconnaissance sequence for unauthorized access. The context makes it more dangerous because the skill automates dork generation, engine selection, and refinement for the user.

Content

Scanner excerpt · SKILL.md (reported line 115)May include surrounding context.

Security scanning — exposed files and panels

python
report = skill.search(
    "find exposed .env files, admin panels, and directory listings on example.com",
    depth="deep",
)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The parser example teaches detection and categorization of exposed .env searches as a first-class security intent, reinforcing credential-hunting as a built-in feature rather than an edge case. That lowers the barrier for misuse and helps automate reconnaissance for secrets across arbitrary domains.

Content

Scanner excerpt · SKILL.md (reported line 630)May include surrounding context.

md
from search_intelligence_skill import IntentParser

parser = IntentParser()
intent = parser.parse("find exposed .env files on example.com")

print(f"Category:    {intent.category.value}")     # security
print(f"Subcategory: {intent.subcategory}")         # exposed_files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/usage.py (reported line 23)May include surrounding context.

python
return

    print("=" * 70)
    print("EXAMPLE 1: Security — Find exposed .env files")
    print("=" * 70)
    report = skill.search(
        "find exposed .env files and admin panels on example.com",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · search_dorks_skill/skill.py (reported line 38)May include surrounding context.

python
return

    print("=" * 70)
    print("EXAMPLE 1: Security — Find exposed .env files")
    print("=" * 70)
    report = skill.search(
        "find exposed .env files and admin panels on example.com",

Credential Access

High
Category
Privilege Escalation
Confidence
77% confidence
Finding

The example issues a query explicitly aimed at finding exposed '.env files and admin panels' on a target domain, which is a classic reconnaissance step toward discovering credentials or privileged access paths. Although it is only a search example, the skill context makes it more dangerous because it operationalizes credential-hunting behavior and lowers the barrier to misuse.

Content

Scanner excerpt · examples/usage.py (reported line 26)May include surrounding context.

python
print("EXAMPLE 1: Security — Find exposed .env files")
    print("=" * 70)
    report = skill.search(
        "find exposed .env files and admin panels on example.com",
        depth="deep",
    )
    print(report.to_context())

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The explicit inclusion of '.env' and adjacent credential-related terms signals support for searching for common secret-bearing files and credentials. On its own this is a small indicator, but in this file it aligns with broader secret-hunting logic and therefore meaningfully contributes to credential-discovery capability.

Content

Scanner excerpt · search_dorks_skill/config.py (reported line 185)May include surrounding context.

python
"directory listing", "index of", "open port", "shodan",
            "sensitive", "credentials", "api key", "secret key",
            "private key", "password", "database dump", "backup file",
            ".env", ".git", ".svn", ".htaccess", "robots.txt",
            "misconfiguration", "insecure", "unprotected",
        ],
    },

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

These dork templates directly generate searches for exposed files, keys, passwords, backups, admin panels, Git metadata, and leak indicators, substantially lowering the barrier to finding sensitive material. The dangerous aspect is not just general search functionality but curated, reusable queries optimized for discovering exploitable exposure and credential-bearing artifacts.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · search_dorks_skill/intent.py (reported line 52)May include surrounding context.

python
# Subcategory detection patterns
SUBCATEGORY_PATTERNS: dict[str, dict[str, list[str]]] = {
    "security": {
        "exposed_files": ["env file", ".env", "exposed file", "config file", "backup file", "log file"],
        "directory_listing": ["directory listing", "index of", "open directory"],
        "admin_panels": ["admin panel", "admin page", "login page", "dashboard", "wp-admin", "phpmyadmin"],
        "sensitive_data": ["password", "credential", "private key", "api key", "secret key", "aws key"],

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README strongly emphasizes privacy and security-research use cases but does not clearly warn that user queries are sent to an external SearXNG instance over HTTP. In agent contexts, this can expose sensitive prompts, OSINT targets, investigation terms, or security-testing queries to a remote service or network observer, creating a meaningful privacy and operational-security risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill clearly enables outbound network access to a SearXNG instance and remote search engines, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, undeclared network capability increases the risk of silent data exfiltration, unexpected web access, and use outside intended authorization controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill advertises security scanning and OSINT use cases up front without immediately warning about authorization, privacy, and legal boundaries. Because the skill is designed for reconnaissance and personal-data discovery, weak early guardrails make misuse more likely in agent-driven workflows.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding

The setup instructions run the SearXNG container using the floating tag latest, which makes builds non-reproducible and can pull an unreviewed upstream image version at any time. That creates supply-chain risk and can unexpectedly introduce vulnerable or malicious image contents into the environment.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · SKILL.md (reported line 1218)May include surrounding context.

python
skill = SearchSkill(
    searxng_url="https://localhost:8888",
    verify_ssl=False,  # ONLY for local dev — never in production
)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The example performs security/OSINT-style searches against an external SearXNG instance without warning that queries may be transmitted to third-party engines or that such searches should only be conducted with authorization. In a security-oriented skill, showing recon-style usage without safeguards can normalize misuse and lead users to send sensitive targets, indicators, or investigative subjects over the network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The direct dork example includes a credential-seeking query pattern and executes it against search engines without cautionary messaging. This increases risk because users may copy a high-sensitivity query that searches for exposed secrets, while the example omits any notice about legal boundaries, privacy implications, or external query transmission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Executing a full 'osint_chain' reconnaissance strategy against a target domain without any authorized-use notice or disclosure of external data transmission encourages potentially intrusive behavior. In context, the skill is specifically designed for broad search and reconnaissance, so omission of safeguards makes misuse more likely and more impactful.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The OSINT-specific ranking logic explicitly boosts results containing indicators like email, phone, LinkedIn, profile, and bio, which steers users toward personal-data-rich content. In a search-intelligence skill focused on dorking and adaptive query refinement, this increases the likelihood of facilitating privacy-invasive searches or misuse for profiling without any guardrails, consent checks, or warning to the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This ranking behavior prioritizes search results likely to contain personal information, yet the skill provides no disclosure, friction, or safety messaging to the user. Given the broader skill context—multi-engine dork generation, intent parsing, and intelligent refinement—the absence of safeguards makes the feature more dangerous because it can systematically optimize for discovery of personal data at scale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The client defaults to base_url='http://localhost:8888', so search queries are sent unencrypted unless the caller explicitly changes it to HTTPS. Although localhost reduces exposure in purely local deployments, SearXNG is often proxied, containerized, or bound to non-local interfaces, and this code provides no warning or enforcement against insecure transport, creating a realistic risk of query disclosure or tampering.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The engine list includes torrent and piracy-focused sources such as Pirate Bay, 1337x, Nyaa, Kickass, and related indexes, which are not necessary for a generic search capability and broaden the tool into copyright-infringing or illicit file discovery. That expansion increases legal and abuse risk and can facilitate locating unauthorized or harmful content.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The configuration explicitly classifies security-oriented intents using terms like 'api key', 'private key', 'password', '.env', and '.git', which steers the skill toward reconnaissance for exposed secrets and misconfigurations. In the context of a broadly described search skill, this materially increases the chance of misuse for credential discovery and unauthorized targeting, even if framed as research.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The intent routing maps OSINT use cases to engines and supports workflows for identifying people, emails, usernames, phone numbers, and IP-linked traces. This is risky because it operationalizes targeted personal-data discovery and makes the skill materially more capable for stalking, doxxing, or intrusive profiling than a normal search helper.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file contains extensive sensitive reconnaissance and exposed-secret search templates but no embedded safeguards, warnings, or limitation logic in the configuration itself. While absence of warning alone is not the root issue, in this context it contributes to unsafe-by-default behavior and makes misuse easier and more likely.

Content

No source excerpt is available for this finding.

Ssd 4

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The security templates create a coherent reconnaissance workflow for finding exposed secrets, administrative interfaces, API surfaces, and version-control artifacts. That cumulative narrative is dangerous because it systematizes pre-attack discovery steps commonly used before exploitation or credential abuse.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.