Back to skill

Security audit

AI大模型专家|豆包 AI搜索收录与引用

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its disclosed AI-HIVE planning and media-generation purpose, but it deserves review because it handles persistent API credentials and can send them to a configurable API endpoint.

Review before installing if you will use real AI-HIVE credentials or upload private media. Keep the API base URL on the official AI-HIVE host unless you fully trust the endpoint, use a limited and revocable API key, and install dependencies in an isolated environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:91
Finding

Unrestricted API endpoint override can disclose bearer credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:91-99, 130-143; scripts/videogen.py:91-99, 130-143
Vulnerability Type: Arbitrary credential-bearing API endpoint
Risk Level: Medium

Vulnerable Code

python
def _resolve_base_url(self, cli_url):
    if cli_url:
        return cli_url.rstrip("/")
    env_url = os.environ.get("AI_HIVE_BASE_URL")
    if env_url:
        return env_url.rstrip("/")
    file_config = self._read_config_file()
    if file_config.get("base_url"):
        return file_config["base_url"].rstrip("/")
    return DEFAULT_BASE_URL
python
def __init__(self, config):
    self.config = config
    self.base = config.base_url
    self.headers = {
        "Authorization": f"Bearer {config.api_key}",
        "Content-Type": "application/json",
    }

def _url(self, path):
    return f"{self.base}/openapi/v1/{path}"

def _request(self, method, url, **kwargs):
    self.config.log(f"{method} {url}")
    try:
        resp = requests.request(
            method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
        )

The same endpoint resolution and request behavior appears in both imagegen.py and videogen.py.

Technical Analysis

The API base URL can be supplied through the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The supplied value is accepted without validating its scheme or hostname.

The client subsequently adds the AI-HIVE API key to the Authorization header of every request sent to that base URL. Consequently, a custom endpoint can receive the bearer credential. The code also permits an unencrypted http:// endpoint, which could expose the credential to network interception.

Exploitation requires an attacker to influence the command line, environment, or ~/.ai-hive/config.json. This could occur through malicious setup instructions, a poisoned shell environment, or unauthorized modific ...[truncated 1310 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require HTTPS for all API endpoints and reject URLs using plaintext HTTP or other schemes.
  2. Allowlist the official AI-HIVE hostname by default.
  3. If custom endpoints are a required feature, require explicit informed confirmation before sending credentials to a nonofficial host.
  4. Store credentials per endpoint rather than automatically reusing an AI-HIVE credential for every configured base URL.
  5. Parse URLs with a standard URL parser and reject embedded credentials, malformed hosts, ambiguous hostnames, and unexpected ports.
  6. Consider removing the base URL override from normal user-facing commands or gating it behind a clearly named development-only option.
  7. Document that users must revoke and rotate the API key immediately if it may have been sent to an untrusted endpoint.

T08 · Insecure Dependencies

Note
Location
SKILL.md:126
Finding

Unpinned third-party dependency installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:126
Vulnerability Type: Unpinned package installation
Risk Level: Low

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The installation instructions request the latest package release matching the name requests, without a pinned version, bounded version range, lock file, or integrity hash. Although requests is the canonical package name and no suspicious package source is specified, the installation is not reproducible and automatically trusts whichever release the package registry resolves at installation time.

This creates supply-chain exposure to a compromised future release, registry compromise, or an incompatible dependency change. It also makes it difficult to verify that all users execute the same audited dependency version.

Attack Path

  1. A malicious or compromised release becomes available through the configured Python package index, or the user's package-index configuration redirects installation to an untrusted repository.
  2. The user follows the documented pip3 install requests instruction.
  3. Package resolution selects the uncontrolled release because no version or hash is specified.
  4. Installation hooks or subsequently imported package code execute in the user's Python environment.
  5. Malicious code could act with the privileges of the user running pip3.

This path depends on compromise or manipulation of the dependency supply chain; the project does not itself reference a known malicious or typosquatted package.

Impact Assessment

If dependency resolution were compromised, malicious package code could execute with the privileges of the installing user. Depending on the environment, this could expose local files, environment variables, API credentials, and network-accessible resources.

The observed instruction alone does not establish active compromise. The practical risk is therefore lower than a de ...[truncated 74 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin requests to an audited version or a narrowly bounded compatible range.
  2. Maintain dependencies in a requirements or lock file rather than an unconstrained shell command.
  3. Use hash verification, such as pip's --require-hashes, where practical.
  4. Regularly review pinned versions for published vulnerabilities and update them through a controlled process.
  5. Recommend installation inside an isolated virtual environment with minimum required privileges.
  6. Where organizational policy permits, configure pip to use a trusted package index or an internally controlled dependency mirror.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared role is advisory and planning-focused, but the described underlying code reportedly includes onboarding flows, credential handling, account/wallet retrieval, raw API invocation, local file upload, and result download. That combination expands the attack surface significantly and can cause users to expose credentials or authorize account-linked actions under a misleadingly narrow description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared role is advisory and planning-focused, but the described underlying code reportedly includes onboarding flows, credential handling, account/wallet retrieval, raw API invocation, local file upload, and result download. That combination expands the attack surface significantly and can cause users to expose credentials or authorize account-linked actions under a misleadingly narrow description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared role is advisory and planning-focused, but the described underlying code reportedly includes onboarding flows, credential handling, account/wallet retrieval, raw API invocation, local file upload, and result download. That combination expands the attack surface significantly and can cause users to expose credentials or authorize account-linked actions under a misleadingly narrow description.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

Enabling implicit invocation without well-defined activation rules creates a meaningful risk that the skill will be auto-selected in ambiguous conversations. Because the skill is positioned to drive end-to-end planning and content-generation workflows, unintended activation could cause unauthorized task execution, inappropriate data sharing into the skill context, or misleading outputs presented as relevant automation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The embedded SKILL_CONFIG repurposes the script into a GPT Image 2 image-generation skill, which directly conflicts with the stated metadata describing a Doubao search/citation planning skill. This hidden functional pivot increases supply-chain risk because reviewers and users may approve or invoke the skill under false assumptions while it uploads images, calls remote generation APIs, and writes downloaded outputs locally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file advertises a Doubao search/citation planning skill, but the implementation is actually a general AI-Hive client for chat, media upload, and image/video generation. This capability mismatch is dangerous because users or higher-level agents may grant permissions, provide prompts, upload files, or store API keys under false assumptions about the skill’s purpose, enabling unintended data flow and tool use.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The embedded SKILL_CONFIG silently repurposes the tool into a short-drama video generator, which materially conflicts with the declared search/citation expert role. In an agent ecosystem, this kind of hidden role drift can cause inappropriate invocation, unexpected media generation, external network access, and user data uploads to third-party services.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises and demonstrates shell execution, environment variable use, file I/O, and network access, but does not declare any tool scope or permission boundaries. This creates an avoidable least-privilege failure: users and hosting platforms cannot easily determine what capabilities the skill may exercise, increasing the risk of unintended command execution, local file access, or credential exposure if the scripts are run.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The invocation wording is very broad and activates on generic user phrases related to search or content goals without clear boundaries. Over-broad triggers can cause accidental activation, increasing the chance that users unintentionally invoke a skill with networked and file-capable workflows or disclose business-sensitive information to it.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The default prompt is broadly scoped and can trigger the skill for a wide range of user goals without clear boundaries on when it should be used. In combination with a generative workflow that produces plans and executable commands, this increases the chance of unintended invocation, over-collection of context, or misuse in situations where the user did not explicitly request this specific skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language description and user-facing strings are entirely in Chinese, including the argparse description and skill name, with no indication that users can choose another language or that the locale restriction is intentional. This can violate the language/locale policy for skills that should not force a language without opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file implements broad AI-Hive capabilities including chat, image/video generation, media upload, task polling, and account access, which materially exceed the declared skill purpose of Doubao search/citation planning. This scope mismatch is dangerous because users or orchestrators may grant trust, permissions, or deployment based on the manifest while the script can perform unrelated remote actions and process local files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring and all user-facing prompts/messages are written in Chinese, including setup, errors, and operational output. For a general-purpose skill, this imposes a specific language on users without opt-in or justification that the skill is China-only or Chinese-only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains user-facing natural-language descriptions and instructions exclusively in Chinese, including the module docstring and later CLI help text. Under the 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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The metadata sets the language to zh-CN, and the skill content is presented entirely in Chinese, but there is no statement that users may choose another language or that the locale restriction is intentional and limited. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.