Back to skill

Security audit

LibTV API Skills

Security checks for vulnerabilities and agentic risk

Overview

This looks like a real LibTV media-generation skill, but it needs review because it can expose the access key or uploaded media through configurable endpoints and unbounded uploads/downloads.

Install only if you are comfortable giving this skill a LibTV access key and sending selected media files to LibTV. Keep OPENAPI_IM_BASE and IM_BASE_URL unset unless you intentionally use a trusted endpoint, review file paths before upload, avoid sensitive media unless remote storage is acceptable, and be cautious with direct download URLs or automatic result downloads.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_common.py:10
Finding

Configurable API Endpoint Can Disclose Credentials and Uploaded Files

Content
View full analysis
dict: """POST request to the agent-im OpenAPI""" url = f"{IM_BASE.rstrip('/')}{path}" data = json.dumps(body).encode("utf-8") req = urllib.request.Request( url, data=data, method="POST", headers=_headers(), ) try: with urllib.request.urlopen(req, timeout=30) as resp: return json.loads(resp.read().decode("utf-8")) ``` From `scripts/upload_file.py`: ```python # accessKey field body_parts.append(f"--{boundary}\r\n".encode()) body_parts.append(b'Content-Disposition: form-data; name="accessKey"\r\n\r\n') body_parts.append(f"{ACCESS_KEY}\r\n".encode()) url = f"{IM_BASE.rstrip('/')}/openapi/upload" req = urllib.request.Request( url, data=data, method="POST", headers={ "Authorization": f"Bearer {ACCESS_KEY}", "Content-Type": f"multipart/form-data; boundary={boundary}", }, ) try: with urllib.request.urlopen(req, timeout=120) as resp: result = json.loads(resp.read().decode("utf-8")) ``` ### Technical Analysis The destination for authenticated API traffic is taken directly from `OPENAPI_IM_BASE` or `IM_BASE_URL`. The implementation does not enforce HTTPS, validate the hostname, restrict ports, or require approval before using a nondefault server. Every session request sends `LIBTV_ACCESS_KEY` in the `Authoriz ...[truncated 1697 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/upload_file.py:25
Finding

Upload Validation Does Not Enforce Documented File-Type and Size Restrictions

Content
View full analysis
Remediation
View remediation
MAX_SIZE: raise ValueError("File exceeds the 200 MB limit") ``` 5. Stream multipart uploads in bounded chunks instead of reading the complete file and constructing a second in-memory copy. 6. Resolve and display the canonical path before upload, and require confirmation for files outside expected user-media directories. 7. Revalidate type and size on the server because client-side checks can be bypassed. 8. Add tests for extensionless files, misleading extensions, malformed media, special files, and files immediately above the size limit. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/download_results.py:58
Finding

Arbitrary URL Downloads Permit Internal Network Access and Unbounded Resource Consumption

Content
View full analysis
Remediation
View remediation
MAX_DOWNLOAD_SIZE: raise ValueError("Download exceeds size limit") f.write(chunk) ``` 7. Write to a temporary file and atomically rename it only after all validation succeeds; delete partial files on errors. 8. Bound `--workers` to a small safe range and limit the number of URLs accepted per invocation. 9. Consider removing arbitrary `--urls` support if generated content should only originate from the LibTV result host. 10. Add tests covering private IP literals, DNS resolution to private addresses, IPv6 loopback, redirects to internal hosts, incorrect content types, and oversized responses. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tainted flow: 'req' from os.environ.get (line 60, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/_common.py (reported line 46)May include surrounding context.

python
headers=_headers(),
    )
    try:
        with urllib.request.urlopen(req, timeout=30) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        err_body = e.read().decode("utf-8") if e.fp else ""

Tainted flow: 'req' from os.environ.get (line 60, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/_common.py (reported line 62)May include surrounding context.

python
headers=_headers(),
    )
    try:
        with urllib.request.urlopen(req, timeout=30) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        err_body = e.read().decode("utf-8") if e.fp else ""

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as media generation/editing, but it also performs bulk downloading, local directory creation, arbitrary file writes, and direct URL-based downloads. That discrepancy is security-relevant because users and orchestrators may not expect local persistence or remote fetch behavior, enabling unnoticed disk writes or retrieval of attacker-influenced content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as media generation/editing, but it also performs bulk downloading, local directory creation, arbitrary file writes, and direct URL-based downloads. That discrepancy is security-relevant because users and orchestrators may not expect local persistence or remote fetch behavior, enabling unnoticed disk writes or retrieval of attacker-influenced content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as media generation/editing, but it also performs bulk downloading, local directory creation, arbitrary file writes, and direct URL-based downloads. That discrepancy is security-relevant because users and orchestrators may not expect local persistence or remote fetch behavior, enabling unnoticed disk writes or retrieval of attacker-influenced content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as media generation/editing, but it also performs bulk downloading, local directory creation, arbitrary file writes, and direct URL-based downloads. That discrepancy is security-relevant because users and orchestrators may not expect local persistence or remote fetch behavior, enabling unnoticed disk writes or retrieval of attacker-influenced content.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger instructions are extremely broad and say the skill must activate for essentially any AI image/video-related request. In an agent environment, overbroad mandatory invocation can route many unrelated or sensitive user interactions into a networked skill that uploads files, creates remote sessions, and may persist outputs, increasing data exposure and the chance of unintended actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

This script performs project/session switching via an OpenAPI endpoint, which is materially broader than the skill’s declared scope of image/video generation and editing. In an agent context, hidden or undeclared context-switching can redirect operations into a different project, causing unauthorized access, cross-project data exposure, or actions being applied to the wrong workspace without clear user intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill declares access to environment-backed credentials and performs networked operations, but it does not constrain tool scope with explicit permissions or allowed-tools. In an agent setting, this increases the blast radius if the skill is triggered unexpectedly or modified later, because it can access secrets and external services without a clearly bounded contract.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs uploading user-provided images or videos to OSS as part of normal operation, but it does not require a privacy warning or explicit acknowledgement that local files will be transferred to a third-party service. This is dangerous because users may provide sensitive media assuming local-only processing, leading to unintended external disclosure and storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation directs the agent to automatically download generated media to local storage after completion without requiring explicit user consent at the time of the write. Automatic local persistence can surprise users, consume disk, place sensitive content on the host, and create retention/privacy issues, especially for generated or edited media derived from private inputs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s docstring, argument descriptions, examples, and user-facing messages are all written in Chinese, and the example prompt content assumes Chinese-language input. This creates a language policy concern because the skill presents a single forced language experience without offering any user opt-in or alternative locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring, argument descriptions, and help text are entirely in Chinese, which imposes a specific language for user interaction. There is no indication that the tool is region-specific or that users can opt into another language, so this appears to violate the language/locale policy described in the audit rules.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The docstring, argument descriptions, and usage text are entirely in Chinese, which imposes a specific language on users without any visible opt-in or alternative locale support. The policy explicitly calls for flagging language or locale constraints when the skill does not offer user choice or document a justified regional limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This code's help text states that LIBTV_ACCESS_KEY is required for Bearer authentication, which indicates the skill depends on sensitive credentials. In this file there is no explicit warning about handling that credential carefully, avoiding exposure in logs, or the fact that it will be used for an authenticated API request.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.