T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:90- Finding
Bearer API Key Can Be Redirected to an Untrusted Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly matches its TikTok/AI-HIVE video workflow purpose, but it handles paid API credentials and uploads with under-scoped endpoint controls that users should review before installing.
Install only if you are comfortable giving this skill access to an AI-HIVE API key and explicitly selected media files. Before using it, verify the configured API endpoint is the official AI-HIVE HTTPS host, avoid command-line API keys where shell history or process listings matter, review any generated parameters before billable submissions, and keep proprietary reference videos limited to material you are authorized to upload.
scripts/videogen.py:90Bearer API Key Can Be Redirected to an Untrusted Endpoint
SKILL.md:63Third-Party Dependency Is Installed Without Version or Integrity Pinning
The skill is positioned as a specialized decomposition assistant, but the detected capabilities include generic API interactions, user account/wallet retrieval, browser-assisted API key setup, local config writes, uploads, downloads, and broad media generation. In context, this is more dangerous because ecommerce/media workflows often involve proprietary assets and paid APIs; undeclared account and billing-related behaviors can expose credentials, leak data, or incur unexpected charges.
The skill is positioned as a specialized decomposition assistant, but the detected capabilities include generic API interactions, user account/wallet retrieval, browser-assisted API key setup, local config writes, uploads, downloads, and broad media generation. In context, this is more dangerous because ecommerce/media workflows often involve proprietary assets and paid APIs; undeclared account and billing-related behaviors can expose credentials, leak data, or incur unexpected charges.
The skill is positioned as a specialized decomposition assistant, but the detected capabilities include generic API interactions, user account/wallet retrieval, browser-assisted API key setup, local config writes, uploads, downloads, and broad media generation. In context, this is more dangerous because ecommerce/media workflows often involve proprietary assets and paid APIs; undeclared account and billing-related behaviors can expose credentials, leak data, or incur unexpected charges.
The skill advertises executable workflows involving shell commands, local file handling, environment variables, and network access, but it does not declare any explicit tool scope or permission boundary. In an agent environment, this increases the risk of over-privileged execution, unintended access to local files or secrets, and surprise network actions that users and reviewers cannot easily constrain.
The trigger conditions are so broad that the skill may activate for routine discussions about TikTok, ecommerce, or advertising rather than only for the specialized authorized-use workflow it claims to serve. Over-broad invocation increases the chance of accidental tool use, irrelevant data collection, unintended external calls, or routing users into a higher-risk skill when a simple text response would suffice.
The skill can be invoked for a broad range of loosely related requests because both the description and default prompt define scope in expansive terms without clear boundaries, prerequisites, or disallowed cases. In an agent environment, ambiguous activation increases the chance the skill is selected for requests involving marketing content generation, code execution guidance, or media replication workflows beyond the user's intent, which can lead to unsafe or policy-inconsistent behavior.
The default prompt hardcodes a production-ready Chinese workflow, which overrides user language preference and may cause the agent to deliver outputs in an unexpected language. While not a direct code-execution issue, this can mislead users, interfere with review or compliance checks, and increase the chance of unsafe downstream use if operators cannot accurately validate generated instructions or AI-HIVE commands.
The docstring and argument parser description use a fixed Chinese title, and the generated JSON embeds Chinese-language skill metadata and artifacts. This creates a natural-language locale constraint in the skill without any opt-in, fallback, or explanation that the tool is intended only for a Chinese-speaking or region-specific context.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(args: list[str]) -> None:
print(" ".join(args))
subprocess.run(args, check=True)
def main() -> None:
The file is presented as a narrowly scoped TikTok Shop video-decomposition skill, but the implementation includes a broad, generic AI Hive client with capabilities unrelated to that purpose. This scope mismatch increases the attack surface and can let downstream agents invoke unintended functions such as account queries, free-form chat, arbitrary uploads, and media generation under the guise of a specialized skill.
Exposing user-info and wallet-balance retrieval is unnecessary for a TikTok Shop video-decomposition workflow and leaks sensitive account metadata to any caller able to invoke the skill. In agent environments, unnecessary identity or billing introspection can aid reconnaissance, privacy violations, or unauthorized cost discovery.
The free-form chat endpoint allows arbitrary text interactions beyond the skill's declared narrow function, creating a general-purpose model access path hidden inside a specialized skill. That can be abused to bypass policy boundaries, perform unrelated tasks, or exfiltrate uploaded media context through prompts in ways reviewers would not expect from a decomposition-only tool.
Standalone image generation is broader than the declared video-decomposition purpose and creates an additional content-generation surface that callers may misuse for unrelated or policy-violating tasks. In a constrained skill ecosystem, hidden extra generation modes undermine least privilege and make abuse or cost escalation easier.
The SKILL_CONFIG value contains the instruction "按海外用户语境改写,不做逐句直译", which imposes a specific locale/audience transformation by default. This is a natural-language policy issue because the behavior is mandated without offering the user a language/locale choice or explaining the constraint as region-specific.
The module docstring presents the skill description entirely in Chinese, and the CLI/user-facing messaging throughout the file is also Chinese-only. For a general-purpose skill, this creates a language/locale constraint without any explicit user opt-in or documented justification.