T09 · Insecure Skill Coding Practices
- Location
scripts/upload_file.py:25- Finding
Arbitrary Local File Disclosure Through Fail-Open Media Validation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This media-generation skill is coherent, but needs Review because it can upload local files and write downloads while using weak validation and unvalidated network destinations.
Review this skill before installing if you handle confidential files, private prompts, paid API keys, or restricted networks. Only use trusted HTTPS API endpoints, avoid giving it sensitive local file paths, confirm where files will be uploaded or downloaded, and use a confined output directory with non-sensitive test credentials first.
scripts/upload_file.py:25Arbitrary Local File Disclosure Through Fail-Open Media Validation
scripts/sora_query_video.py:80Bearer Credentials and User Content Sent to Unvalidated API Destinations
scripts/download_results.py:58Unrestricted URL Download Enables Server-Side Request Forgery and Local Resource Access
scripts/download_results.py:119Path Traversal Through Unsanitized Output Filename Prefixes
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers=_headers(),
)
try:
with urllib.request.urlopen(req, timeout=30) as resp:
status = resp.status
raw = resp.read().decode("utf-8")
if not raw.strip():
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers=_headers(),
)
try:
with urllib.request.urlopen(req, timeout=30) as resp:
status = resp.status
raw = resp.read().decode("utf-8")
if not raw.strip():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cp .env.example .env
LIBTV_ACCESS_KEY)。Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
---
name: libtv-skill
description: >-
agent-im 会话技能 - 通过 liblib.tv 的 AI 能力生成和编辑图片/视频,兼容 Gemini 文生图、Sora/Veo/Grok/豆包/Vidu 视频直连。
The manifest trigger-word list includes broad, ambiguous terms and platform references that are insufficiently precise for safe invocation. Because the skill can upload files, call external APIs, and download outputs, weak activation boundaries increase the chance of unintended execution and data transfer.
The skill states that any request involving image/video creation or editing 'must' trigger the skill, and the examples include very generic phrases. This creates overbroad activation that can capture normal conversation and route users into networked generation, upload, polling, and download flows without sufficiently specific user intent.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
return default
def resolve_env_file_from_argv(argv, env_var_name: str = "SORA_ENV_FILE", default_env_file: str = ".env") -> str:
"""Pre-parse --env-file so defaults can use loaded env values."""
for i, arg in enumerate(argv):
if arg == "--env-file" and i + 1 < len(argv):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
return default
def resolve_env_file_from_argv(argv, env_var_name: str = "SORA_ENV_FILE", default_env_file: str = ".env") -> str:
"""Pre-parse --env-file so defaults can use loaded env values."""
for i, arg in enumerate(argv):
if arg == "--env-file" and i + 1 < len(argv):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
return default
def resolve_env_file_from_argv(argv, env_var_name: str = "SORA_ENV_FILE", default_env_file: str = ".env") -> str:
"""Pre-parse --env-file so defaults can use loaded env values."""
for i, arg in enumerate(argv):
if arg == "--env-file" and i + 1 < len(argv):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
return default
def resolve_env_file_from_argv(argv, env_var_name: str = "SORA_ENV_FILE", default_env_file: str = ".env") -> str:
"""Pre-parse --env-file so defaults can use loaded env values."""
for i, arg in enumerate(argv):
if arg == "--env-file" and i + 1 < len(argv):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env_file(env_file: str) -> str:
"""Load KEY=VALUE .env file without overriding existing process env."""
if not env_file:
return ""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env_file(env_file: str) -> str:
"""Load KEY=VALUE .env file without overriding existing process env."""
if not env_file:
return ""
This markdown file documents required credentials and a remote API gateway, indicating the skill will send user-provided content to external services. While it notes not to commit keys, it does not warn users that prompts or generated media requests may be transmitted to third-party providers, which is a user-facing privacy and safety disclosure gap under the markdown criteria.
The README describes sending prompts, images, and videos to LibTV and multiple third-party generation services, but it does not warn users that their content may be transmitted to external providers and processed under those providers' retention, privacy, and policy regimes. This can lead to accidental disclosure of sensitive prompts or uploaded files, especially in an agent context where users may not realize data leaves the local environment.
The skill instructs bulk downloading of generated images/videos to local disk and even naming/output-directory behavior, but it does not prominently warn users up front that local file writes will occur. In a skill that handles externally sourced URLs and generated media, silent or under-disclosed disk writes raise consent, storage, and malware-adjacent safety concerns.
The smoke-test instructions direct users to run provider-specific commands that will contact external services, but they do not clearly warn that prompts, task identifiers, and possibly other request metadata will be transmitted off-host. In a repo context, this can cause unintentional disclosure of test data, unexpected billing, or use of real credentials during routine validation.
Artifact content does not match its filename extension
Artifact content does not match its filename extension
This markdown file presents the output-format instructions only in Chinese, starting from the title and introductory description. Under the stated policy, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.
The usage guide instructs users to send prompts, local reference images, and remote image URLs to third-party provider APIs, but it does not warn that this content will leave the local environment and may contain sensitive data. In a skill that handles image/video generation across multiple external providers, this omission can lead users to unintentionally transmit proprietary, personal, or regulated content.
The workflow explicitly instructs automatic downloading of generated files to a local directory without requiring user confirmation or warning that local files will be written. In an agent setting, this can cause unexpected filesystem side effects, overwrite risks, storage abuse, or silent placement of untrusted content on disk, especially because the behavior is framed as mandatory after task completion.
The workflow tells the agent to upload user-supplied images or videos to an OSS endpoint as a default step, but provides no notice, consent check, or data-handling warning. This creates a real privacy and data-exfiltration risk because potentially sensitive local files are transmitted to external storage automatically as part of normal operation.
This code emits user-facing validation errors exclusively in Chinese, such as at L19, L21, L33, L42, L44, L50, and L54. That creates a language policy issue because the skill enforces a specific locale without offering a user choice or documenting that it is intentionally Chinese-only.
This Python file contains all user-facing natural-language strings in Chinese, including the module docstring, function docstrings, argument descriptions, and usage examples. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
The file's docstring, CLI description, help text, and examples are entirely in Chinese, which imposes a specific language on users without any opt-in or stated regional justification. Under the language/locale policy, hardcoding a single language for user-facing interaction can be a policy violation when no choice or constraint is explained.
No suspicious patterns detected.