Back to skill

Security audit

Anime Finder

Security checks for vulnerabilities and agentic risk

Overview

This is a real anime search and download helper, but it should be reviewed because it can automatically queue torrent downloads, start Transmission, and persist preferences/state from broad natural-language requests without a clear confirmation boundary.

Install only if you want an agent to search public anime torrent sources and potentially queue downloads. Prefer search-only or cli-only use, review any proposed torrent before downloading, and clear or inspect state/user_profile.json and state/last_download.json if you do not want saved preferences or download history.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/workflow.py:309
Finding

Magnet URI Parameter Injection Through Unencoded Release Titles

Content
View full analysis
str: return f"magnet:?xt=urn:btih:{infohash}&dn={name}" ``` ### Technical Analysis The release name is inserted directly into the `dn` parameter of a magnet URI without percent-encoding. This name originates from the title field of a remote Nyaa RSS response and therefore crosses an external trust boundary. If a release title contains magnet URI delimiters such as `&`, the resulting value can escape the intended `dn` parameter and introduce additional parameters. For example, a title containing `&tr=https://attacker.example/announce` can add an attacker-controlled tracker to the generated magnet URI. The parser applies HTML entity decoding to RSS titles, so a title represented as `&tr=...` in valid XML may become `&tr=...` before reaching `_magnet()`. The associated `infohash` is also accepted without format validation. Although the fixed `xt=urn:btih:` prefix limits the direct effect of that field, validating it would strengthen the same URI-construction boundary. ### Attack Path 1. An attacker causes a matching release with a specially crafted title to appear in the Nyaa search results. 2. `scripts/search_nyaa.py` reads and HTML-decodes the remote title. 3. Ranking logic selects the crafted release as the best result. 4. `queue_download()` passes the untrusted title to `_magnet()`. 5. `_magnet()` concatenates the title directly into the URI. 6. The generated magnet link contains injected parameters such as an attacker-controlled tracker or web seed. 7. If the user opens the magnet link, the torrent client processes the injected parameters. ### Impact Assessment Successful exploitation can modify the semantics of a returned magnet URI. An attacker may add tracker or web-seed endpoints, potentially causing the u ...[truncated 378 chars]
Remediation
View remediation
str: if not re.fullmatch(r"(?:[0-9A-Fa-f]{40}|[A-Z2-7]{32})", infohash): raise ValueError("Invalid BitTorrent infohash") encoded_name = quote(name, safe="") return f"magnet:?xt=urn:btih:{infohash}&dn={encoded_name}" ``` Additional hardening should include: 1. Limit release-title length before including it in output. 2. Reject control characters in externally supplied titles. 3. Construct query parameters through a dedicated URI encoder rather than string concatenation. 4. Add tests using titles containing `&tr=`, `&ws=`, `#`, `%`, spaces, and Unicode characters. 5. Ensure callers convert validation failures into a structured `blocked` or fallback response rather than terminating unexpectedly. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/search_nyaa.py:500
Finding

Malformed Remote RSS Metrics Can Terminate the Workflow

Content
View full analysis
Remediation
View remediation
int: if value is None: return default value = value.strip() if not re.fullmatch(r"\d{1,10}", value): return default return min(int(value), 2_147_483_647) ``` Use it when constructing results: ```python "seeders": _safe_nonnegative_int( seeders_match.group(1) if seeders_match else None ), "leechers": _safe_nonnegative_int( leechers_match.group(1) if leechers_match else None ), "downloads": _safe_nonnegative_int( downloads_match.group(1) if downloads_match else None ), ``` Additional hardening should include: 1. Catch parsing exceptions at the remote RSS trust boundary. 2. Skip malformed items while adding a warning rather than failing the entire search. 3. Validate and bound title, size, infohash, and torrent identifier fields. 4. Replace regular-expression-based XML parsing with a standard XML parser configured to avoid external-entity processing. 5. Add regression tests covering empty, negative, excessively large, decimal, and non-numeric metric values. ]]>
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The implemented code is a search utility for Nyaa.si RSS. It accepts a query and aliases, fetches RSS results over HTTP, parses titles/sizes/seeders/infohashes, filters probable video releases, can target a specific episode, can filter to the latest detected season, infers the latest episode number, scores/ranks results, and outputs structured results including a magnet link for the best match. These behaviors do align with parts of the description such as finding anime releases, handling aliases/shorthand-like multiple queries, '看最新一集', '拿最新一季第一集' support in a partial sense via episode/latest-season filtering, and '只要磁力/先找资源别下载' insofar as it surfaces magnet information without downloading. However, the description materially overstates capability by claiming end-to-end handling including downloading and checking download status. No code exists for invoking a downloader, saving files, monitoring progress, or accessing prior task state. Therefore the description does not accurately represent the actual narrower search-only behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is a clear description-behavior mismatch. The declared purpose describes a broad anime resource workflow centered on finding releases and optionally downloading them. The supplied code chunk is a narrow helper that validates/normalizes anime identity using Bangumi metadata. While title verification may support a larger pipeline and does handle some raw queries by stripping season/episode terms, the primary behavior is materially different from the declared end-to-end functionality. There are no undeclared dangerous capabilities, but the implemented scope is far smaller and different than what is claimed.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow can automatically queue torrent downloads and even start transmission-daemon based on parsed intent/profile state, without a mandatory user confirmation gate in this code path. In the context of an agent skill handling raw user utterances and mixed-language commands, this increases the risk of unintended downloads, bandwidth/storage abuse, and execution of side effects from ambiguous or prompt-manipulated requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README explicitly promotes high-confidence auto-download behavior and describes persistent local state, but it does not clearly warn that invoking the workflow may queue downloads or retain request/download history in local files. In an agent context, this increases the risk of unintended content acquisition and silent state persistence from ambiguous natural-language requests.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

The documented autonomy mode includes auto_execute, meaning the skill is designed to let the agent take actions without an additional confirmation step when it judges confidence to be high. In this skill's context, those actions can trigger torrent queuing or magnet handling for user-supplied natural language, so incorrect intent resolution or prompt ambiguity can directly cause unauthorized downloads.

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

md
- `confidence`: `high` / `medium` / `low`
- `confirmation_required`: whether the agent should stop and ask exactly one question
- `autonomy_mode`: `auto_execute` / `ask_once` / `halt`
- `profile_applied`: which fields came from the persisted user profile
- `reason_codes`: machine-readable reasons behind the decision

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises and instructs execution of a shell-based workflow that appears to perform file reads/writes, network access, and downloader-related actions, but it declares no explicit tool scope or permission boundaries. That creates an authorization ambiguity where an agent may invoke powerful capabilities without clear least-privilege constraints or user-visible approval expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation guidance is overly broad, telling the agent to use the skill for raw user utterances, aliases, shorthand, and mixed-language phrases without clear boundaries. Broad routing rules can cause unintended invocation of a network/shell-capable skill on ambiguous requests, increasing the chance of unsafe execution, privacy leakage, or undesired downloader actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instructions describe operations with external and persistent effects, including downloads and writes to runtime state files, but they do not require explicit warning or consent before those actions occur. In an agent setting, this can lead to silent filesystem changes, downloader queueing, and network activity that the user did not fully understand or intend.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The default prompt uses broad, everyday trigger phrases such as 找番, 追更, 最新一集/最新一季, and 先搜别下, which can match casual conversation without strong scoping. This increases the chance of unintended skill activation for requests involving anime discovery or downloads, causing the agent to take over actions the user did not explicitly mean to delegate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt hard-codes Chinese-language examples and phrasing without stating a locale restriction or offering language choice, which can cause incorrect routing or exclusion of users who phrase requests differently. In a skill that can handle end-to-end downloads, this ambiguity can contribute to accidental activation or misunderstanding of user intent across languages.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

By default, this wrapper adds --download and a writable --download-dir unless --search-only is set, causing a user-supplied query to trigger immediate download behavior and disk writes without an explicit confirmation step in this file. In the context of an agent skill that handles end-to-end anime discovery and downloading, this increases the risk of unintended content retrieval, storage of potentially infringing or unsafe files, and surprise side effects from ambiguous user requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The example "以后默认给我 1080p 简中,顺手下载 JOJO" suggests a persistent default for Chinese-language subtitle preferences without clearly establishing user consent boundaries or scoping. While this is not a direct code execution issue, it can cause privacy and preference-handling problems by assuming locale defaults and applying them to later requests without explicit opt-in per session or durable preference storage rules.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The minimal-context trigger examples are broad enough that short, ambiguous inputs like "JOJO" or "钢炼 03" could invoke this skill without clear user intent to search or download anime content. In this skill, which can perform end-to-end resource finding and downloading, over-triggering increases the risk of unintended actions, misrouting user requests, and initiating piracy-related workflows from insufficient context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The intent parsing logic is heavily specialized around Chinese-language phrases and subtitle preferences such as simplified and traditional Chinese, but there is no natural-language indication of user opt-in or locale choice. This can amount to a language/locale policy issue because the skill behavior is effectively biased toward a specific language environment by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The parser converts ordinary user phrasing such as '以后/默认/记住' and '直接下/自动下' into persistent profile changes, including enabling automatic high-confidence downloads, without any confirmation gate in this code path. In a skill that handles anime resource discovery and downloading, this can let a single ambiguous or prompt-injected message permanently change future behavior and trigger unwanted downloads, increasing risk of unsafe content acquisition or policy-bypassing automation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This script performs network search against Nyaa.si, parses RSS results, filters episodes/seasons, scores matches, and outputs search results plus a magnet link. It does not initiate any download, manage a downloader, or inspect prior download status, so it implements only a subset of the broader manifest claim to 'handle the whole request end to end.'

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Multiple user-visible strings, warnings, labels, and output messages are hard-coded in Chinese, and subtitle scoring also prioritizes Chinese labels. There is no opt-in, language selection, or justification that this skill is intended only for Chinese-speaking users, which conflicts with the language/locale policy described.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/verify.py (reported line 62)May include surrounding context.

python
Returns (results, api_ok). api_ok is False on network/API errors.
    Retries up to 2 times with 3s interval on timeout.
    """
    url = f"https://api.bgm.tv/search/subject/{urllib.parse.quote(query)}?type=2"
    max_retries = 2

    for attempt in range(max_retries + 1):

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/verify.py (reported line 85)May include surrounding context.

python
Returns (results, api_ok). api_ok is False on network/API errors.
    Retries up to 2 times with 3s interval on timeout.
    """
    url = f"https://api.bgm.tv/search/subject/{urllib.parse.quote(query)}?type=2"
    max_retries = 2

    for attempt in range(max_retries + 1):

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file contains multiple natural-language strings shown to users, and they consistently force Chinese-language responses. The policy specifically flags language or locale constraints when the skill does not offer a choice or document justified region-specific behavior.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/workflow.py (reported line 325)May include surrounding context.

python
def _run_command(command: list[str]) -> subprocess.CompletedProcess[str]:
    return subprocess.run(command, text=True, capture_output=True, check=False)


def _ensure_transmission(download_dir: str) -> tuple[bool, str | None]:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/workflow.py (reported line 334)May include surrounding context.

python
if _run_command(["pgrep", "-x", "transmission-daemon"]).returncode != 0:
        os.makedirs(os.path.expanduser("~/.transmission"), exist_ok=True)
        subprocess.Popen(
            [
                "transmission-daemon",
                "--config-dir",

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
92% confidence
Finding

The decision model explicitly supports an auto_execute autonomy mode, meaning the skill is designed to carry out actions without an additional confirmation step when certain conditions are met. In a media-download skill that can trigger network activity, daemon startup, and disk writes, autonomous execution makes misclassification and unsafe side effects materially more dangerous.

Content

Scanner excerpt · scripts/workflow.py (reported line 761)May include surrounding context.

python
elif confirmation_required:
        autonomy_mode = "ask_once"
    else:
        autonomy_mode = "auto_execute"

    return {
        "confidence": intent.get("confidence", "medium"),

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code persists user preference/profile updates to disk automatically when parse_intent requests it, but there is no visible disclosure or consent check in this path before writing to state/user_profile.json. Persisting behavioral preferences and request-derived metadata can create privacy and surprise risks, especially in an autonomous agent context where the user may not realize their requests modify long-lived local state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

At L085 the test requires the exact Chinese query string "飙马野郎 JOJO的奇妙冒险 第一赛段", and elsewhere the file uses Chinese-only user queries/messages. This indicates the skill behavior is expected to force a specific language/locale rather than offering user choice, which matches the language/locale policy-violation category.

Content

No source excerpt is available for this finding.