Back to skill

Security audit

胡田 OPC导师 视频字幕工具

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated video dubbing/subtitle purpose, but it ships an exposed Coze API credential and sends user video/text data to a third-party workflow without sufficiently clear user consent.

Review this skill before installing. It appears intended to perform cloud-based video dubbing/subtitle generation, so external processing is part of how it works, but the package should not contain a reusable API token. Install only if you are comfortable sending video URLs and subtitle text to Coze and the publisher has removed or rotated the embedded credential and documented the data flow clearly.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/video_subtitle.py:150
Finding

Hard-Coded Coze API Bearer Token

Content
View full analysis

Vulnerability Details

File Location: scripts/video_subtitle.py, lines 150–154
Vulnerability Type: Hard-coded authentication credential
Risk Level: High

Vulnerable Code

python
# Credential environment variable name: COZE_SKILL_{SKILL_ID}_TOKEN
#credential = os.getenv(f"COZE_SKILL_{SKILL_ID}_TOKEN")
credential="sat_OtJcareEHqNnrVVZJ9RFk0bCfD3wI4fVzGID9bqXcofEw9nyecAT9EhRr9nFyInR"
if credential:
    headers["Authorization"] = f"Bearer {credential}"

Technical Analysis

The script embeds a Coze bearer token directly in source code while disabling the safer environment-variable lookup. Any party with access to the source package, repository history, build artifacts, logs containing source, or redistributed copies can recover the credential without authentication.

The script attaches the exposed token to the Authorization header when calling the Coze workflow endpoint. If the token remains valid, an attacker can replay it outside this application. Bearer credentials generally grant access based solely on possession, so exploitation does not require knowledge of another secret.

Attack Path

  1. An attacker downloads, clones, or otherwise obtains a copy of the project.
  2. The attacker opens scripts/video_subtitle.py and extracts the token from line 152.
  3. The attacker constructs requests containing:
    http
    Authorization: Bearer <extracted-token>
    
  4. The attacker sends authenticated requests to the configured Coze API endpoint, such as https://api.coze.cn/v1/workflow/run.
  5. Subject to the token's actual validity and permissions, the attacker invokes accessible workflows or consumes associated resources and quotas.

Impact Assessment

If the credential is active, an attacker may gain the same Coze API privileges assigned to that token. The concrete scope depends on server-side token permissions, but potential consequences include:

  • Unauthorized execution of the configured or otherwise accessible work ...[truncated 455 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke and rotate the exposed token. Treat it as compromised even if there is no known abuse.
  2. Remove the credential from the current source and repository history. Use an appropriate history-rewriting tool if it was committed, then invalidate all affected clones and artifacts where practical.
  3. Restore external secret loading, for example:
    python
    credential = os.getenv(f"COZE_SKILL_{SKILL_ID}_TOKEN")
    if not credential:
        raise RuntimeError("Required Coze API credential is not configured")
    
    headers["Authorization"] = f"Bearer {credential}"
    
  4. Use a managed secret store in production rather than embedding secrets in source, configuration committed to version control, or command-line arguments.
  5. Apply least privilege. Limit the replacement credential to only the required workflow and operations.
  6. Prefer short-lived credentials and automated rotation where the provider supports them.
  7. Add secret scanning to pre-commit hooks and CI pipelines to prevent future credential commits.
  8. Review Coze audit and billing logs for unauthorized requests made with the exposed token.
  9. Avoid logging authorization headers or credentials in application and HTTP diagnostic logs.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to add dubbing and subtitles, but the behavior includes authenticated calls to an external Coze workflow using a hardcoded token and undeclared third-party network access. Hardcoded credentials are highly sensitive because they can be extracted, reused, and abused, while the undeclared external processing creates covert data transfer of user-supplied video URLs and text.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill does not clearly inform users that public video URLs and subtitle/voice text will be sent to an external Coze workflow for processing. This lack of disclosure undermines informed consent and can expose potentially sensitive user content to a third party, especially if users assume processing is local or first-party.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The comments indicate credentials should come from an environment variable, but the implementation bypasses that control and hardcodes a bearer token directly in source. Hardcoded secrets are easily leaked through repositories, logs, or package distribution and are difficult to rotate safely once exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

A hardcoded credential is used in an authenticated outbound request without any user-facing disclosure, meaning users may unknowingly send their content through a privileged third-party workflow. This combines secret exposure with opaque data handling, increasing the chance of abuse if the token is reused or the workflow processes sensitive media.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README describes the skill trigger as broadly applying whenever a user needs dubbing, subtitles, style selection, or custom subtitle styling, but it provides no clear scope boundaries, exclusions, or input constraints. In an agent environment, overly broad trigger conditions can cause the skill to activate in unintended contexts, increasing the chance of unsafe file handling, misuse on sensitive media, or incorrect orchestration with other tools.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation declares no explicit tool scope or permissions, yet the referenced implementation is described as using network access and likely environment-backed secrets. This creates an authorization and transparency gap: an agent may invoke capabilities beyond what the manifest communicates, increasing the risk of unintended data egress or misuse of hidden execution privileges.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

L014 将触发条件定义为“用户需要为视频配音并添加字幕时”,这是面向意图的宽泛描述,没有列出明确触发短语、适用上下文或不适用情形。对于 markdown 技能说明,这种表述容易与一般性视频编辑咨询重叠,增加非预期调用风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

从 L128 开始的“回复规则”“回复样例”全部以固定中文输出形式约束代理回复,且未说明这是用户可选语言或仅适用于特定中文场景。根据自然语言政策要求,强制特定语言而无用户选择属于语言/locale 策略问题。

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/video_subtitle.py (reported line 140)May include surrounding context.

python
"""
    # ====================== 你必须换成自己的工作流地址 ======================
    # Coze 工作流运行端点
    workflow_url = "https://api.coze.cn/v1/workflow/run"
    # 工作流 ID(如果有独立的工作流 ID)
    workflow_id = "7629543630663221284"
    # ====================================================================

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script embeds and uses a bearer token to invoke an external Coze workflow, causing user-supplied video URLs and subtitle text to be transmitted to a third-party service under the developer's credentials. In this skill's context, external processing may be functionally relevant, but doing so with an undisclosed hardcoded credential creates unauthorized capability and secret exposure risk beyond the narrow user-visible behavior.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The script transmits user-provided video URLs, subtitle text, voice selection, and style parameters to an external API. External transmission is expected for a cloud workflow, but in this skill context it is still security-relevant because potentially sensitive media metadata and content leave the local trust boundary, especially when paired with hidden authentication.

Content

Scanner excerpt · scripts/video_subtitle.py (reported line 186)May include surrounding context.

python
print(f"[INFO] 语速: {speed}", file=sys.stderr)

    try:
        response = requests.post(workflow_url, headers=headers, json=payload, timeout=600)
        
        if response.status_code >= 400:
            raise Exception(f"HTTP请求失败: {response.status_code}, {response.text}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The default voice ID is set to "zh-CN-YunxiNeural", which enforces a specific language/locale if the user does not override it. This is a natural-language policy concern because the script does not ask the user to choose a language or clearly obtain opt-in before applying a locale-specific default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing instructions only in Chinese, which can constitute a language/locale policy issue when no opt-in or alternative language is provided. The file does not indicate that the skill is region-specific or that Chinese is a documented requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This markdown file is entirely written in Chinese and the command examples hard-code a Chinese voice locale (zh-CN-YunxiNeural) and Chinese subtitle text, without indicating that other languages or locales are supported. Under the policy rule for natural-language violations, this can be read as imposing a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.