Back to skill

Security audit

magnet-search

Security checks for vulnerabilities and agentic risk

Overview

This skill openly searches torrent indexes and returns magnet download links, but it has legal-use ambiguity, under-disclosed network destinations, and unsafe TLS handling.

Install only if you intentionally want a torrent magnet-search helper and are prepared to restrict use to lawful, authorized content. Be aware that search terms are sent to third-party torrent services, HTTPS validation is disabled in the current code, and the package appears incomplete or broken, so results could be tampered with and the tool may not run correctly.

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
magnet-search.py:34
Finding

Global TLS Certificate and Hostname Verification Disabled

Content
View full analysis

Vulnerability Details

File Location: magnet-search.py, lines 34-36; the insecure context is used at lines 51-52
Vulnerability Type: Improper TLS certificate validation
Risk Level: High

Vulnerable code:

python
self.ssl_context = ssl.create_default_context()
self.ssl_context.check_hostname = False
self.ssl_context.verify_mode = ssl.CERT_NONE

Affected request code:

python
req = urllib.request.Request(url, headers=self.get_headers())
with urllib.request.urlopen(req, context=self.ssl_context, timeout=timeout or self.timeout) as r:
    data = r.read()

Technical Analysis

The application creates a shared SSL context and explicitly disables both hostname checking and certificate verification. Every HTTPS request issued by fetch() uses this context. Consequently, the client accepts an arbitrary certificate without confirming that it was issued by a trusted certificate authority or belongs to the requested host.

An attacker with a suitable network interception position can impersonate configured torrent-search services, observe submitted search terms, and modify API, HTML, or RSS responses. The forged response can contain attacker-selected torrent metadata and magnet hashes. The reviewed code does not execute fetched content, so this issue alone does not establish remote code execution.

Attack Path

  1. A user invokes the Skill with a search query.
  2. The application constructs an HTTPS request to one of its configured external search services.
  3. An attacker able to intercept network traffic presents an arbitrary certificate and impersonates that service.
  4. Because certificate and hostname verification are disabled, the application accepts the attacker's TLS endpoint.
  5. The attacker reads the search query and returns manipulated JSON, HTML, or RSS content.
  6. Where the relevant parser accepts the response, the application presents attacker-controlled torrent metadata ...[truncated 511 chars]
Remediation
View remediation

Remediation Suggestions

  • Retain the secure defaults from ssl.create_default_context() and remove both insecure assignments:
    python
    self.ssl_context = ssl.create_default_context()
    
  • Do not fall back to ssl.CERT_NONE when certificate validation fails. Report the connection failure and skip the affected source.
  • Continue passing the verified context to urllib.request.urlopen, or omit the custom context and use Python's secure default HTTPS behavior.
  • Ensure the runtime trust store is current and configure an explicit trusted CA bundle only when required.
  • Add tests confirming that expired, self-signed, hostname-mismatched, and untrusted certificates are rejected.
  • Consider applying response-size limits and stronger schema validation to external responses as defense in depth.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (9)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is explicitly designed to query well-known torrent piracy indexes and generate ready-to-use magnet links, which materially enables downloading copyrighted content rather than merely discussing it. The stated 'personal study/research' justification conflicts with the implementation, increasing suspicion that the manifest is attempting to disguise a piracy-enabling tool.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill explicitly relies on external network access to query torrent index APIs, but the manifest does not declare any tool scope or allowed-tools restriction. In an agent environment, undeclared network capability reduces governance and reviewability, making it easier for the skill to access external services without clear operator consent or policy enforcement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

All user-facing instructions, examples, and interaction text are presented only in Chinese, and the examples assume Chinese-language usage. There is no opt-in for language preference and no documented reason that the skill must be Chinese-only, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger examples are broad requests like searching for movie magnet links or download resources, which directly facilitate access to copyrighted content from piracy-oriented sources such as ThePirateBay and Nyaa. In context, this is more dangerous than a generic search helper because the skill is purpose-built to locate infringing download links and could be invoked by ordinary user phrasing without meaningful safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The natural-language header describes the skill entirely in Chinese and presents that as the default interface/description, with no indication that users may opt into another language. This can violate language/locale policy when a skill imposes a specific language without user choice or documented regional scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code disables TLS certificate validation and hostname checking for all outbound HTTPS requests, allowing man-in-the-middle interception or tampering with responses from remote sources. In this context, that means search results, metadata, or returned magnet links could be silently modified by an attacker.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · magnet-search.py (reported line 50)May include surrounding context.

python
'Accept': 'application/json, text/html, application/rss+xml',
                'Accept-Encoding': 'gzip, deflate'}
        
    def fetch(self, url, timeout=None):
        try:
            req = urllib.request.Request(url, headers=self.get_headers())
            with urllib.request.urlopen(req, context=self.ssl_context, timeout=timeout or self.timeout) as r:

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · magnet-search.py (reported line 61)May include surrounding context.

python
'Accept': 'application/json, text/html, application/rss+xml',
                'Accept-Encoding': 'gzip, deflate'}
        
    def fetch(self, url, timeout=None):
        try:
            req = urllib.request.Request(url, headers=self.get_headers())
            with urllib.request.urlopen(req, context=self.ssl_context, timeout=timeout or self.timeout) as r:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill issues outbound HTTP requests to multiple third-party torrent sources and reads their responses, but there is no confirmation prompt, logging, print statement, or explanatory comment/docstring near the operation. For a code file, this is a missing disclosure about network activity that may expose user search terms to external services.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.