T09 · Insecure Skill Coding Practices
- Location
model/scripts/veo_worker.py:68- Finding
Unscoped Provider Credential Sent to a Hard-Coded External Service
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does generate videos as described, but it handles local API credentials, background execution, runtime installs, and automatic browser opening in ways users should review carefully.
Install only if you are comfortable with this skill reading your OpenClaw model-provider config, sending prompts and an API key to the Wanjie endpoint, starting detached background work, writing response/result files locally, and opening provider-returned links automatically. Use a dedicated low-privilege API key and review whether any scheduled task or monitor is installed.
model/scripts/veo_worker.py:68Unscoped Provider Credential Sent to a Hard-Coded External Service
model/scripts/veo_worker.py:103Untrusted Model-Generated URL Is Opened Automatically
model/scripts/video_interface.py:7Runtime Installation of an Unpinned Dependency
model/scripts/veo_worker.py:96Remote Response and Result URL Persisted in Plaintext
The README promotes conversational, natural-language triggering but does not define clear activation boundaries, allowed intents, or safeguards against accidental invocation. In an agent skill context, ambiguous triggers increase the chance that unrelated user text or prompt content could launch video-generation workflows unexpectedly, especially when paired with autonomous background behavior.
The README explicitly describes automatic dependency installation over the network and automatic background restart/polling, but does not provide a clear warning about outbound connectivity, persistent execution, or system-side effects. This is risky because users may unknowingly permit code to download packages and maintain self-restarting processes, which expands attack surface and can conceal unintended or abusive behavior in an agent environment.
The trigger model is described as accepting a very broad natural-language phrase ('生成视频:[您的提示词]') with no clear activation boundaries or confirmation step. In an agent environment, this increases the chance of accidental invocation or prompt-driven abuse, especially because the skill also claims to automatically launch background processing after interception.
The skill states that it will start periodic background monitoring every 5 minutes and write results to a log/output file, but it does not present an explicit warning or obtain informed user consent for ongoing system changes. Persistent background execution and file writes can surprise users, create privacy and resource risks, and make the skill harder to audit or stop once activated.
Documenting deployment of a Windows scheduled task ('OpenClaw_Veo_Monitor') without a strong caution about persistence is dangerous because scheduled tasks modify the host system and can continue running beyond the user's immediate session. In the context of an agent skill that already advertises autonomous monitoring, this increases the risk of stealthy persistence, unexpected execution, and difficulty in user oversight.
The skill launches a detached background Python process from user-controlled chat input and immediately returns, which reduces visibility, auditability, and user control over what continues executing after the request ends. The reply states that a browser will open automatically, but the user is not meaningfully prompted for consent and the detached execution makes abuse harder to monitor or stop if the downstream script performs unexpected actions.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if platform.system() == 'Windows':
os.startfile(url)
elif platform.system() == 'Darwin': # macOS
subprocess.Popen(['open', url])
else: # Linux
subprocess.Popen(['xdg-open', url])
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
elif platform.system() == 'Darwin': # macOS
subprocess.Popen(['open', url])
else: # Linux
subprocess.Popen(['xdg-open', url])
def is_process_running(pid):
"""检查指定 PID 的进程是否在运行"""
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 如果没有 psutil,使用简单但有效的方法
import subprocess
if platform.system() == 'Windows':
res = subprocess.run(['tasklist', '/FI', f'PID eq {pid}'], capture_output=True, text=True)
return str(pid) in res.stdout
return True # 默认不删除锁,以防误删
The script silently reads an API key from the user's local configuration and transmits user-supplied prompt content to a third-party remote endpoint. In an agent/skill context, this is security-relevant because it can exfiltrate potentially sensitive user data and use local credentials without an explicit consent or disclosure boundary in the code path.
This code sends user-provided prompt data and a bearer-authenticated request to an external API endpoint, creating a clear data egress path. In the absence of explicit trust, consent, or data-classification controls, this can expose sensitive prompts or operational metadata to a third party in a way users may not expect.
}
print(f"[*] API 请求发送中... (Model: {model})", flush=True)
res = requests.post("https://maas-openapi.wanjiedata.com/api/v1/chat/completions",
headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
json=payload, stream=True)
This code sends user-provided prompt data and a bearer-authenticated request to an external API endpoint, creating a clear data egress path. In the absence of explicit trust, consent, or data-classification controls, this can expose sensitive prompts or operational metadata to a third party in a way users may not expect.
}
print(f"[*] API 请求发送中... (Model: {model})", flush=True)
res = requests.post("https://maas-openapi.wanjiedata.com/api/v1/chat/completions",
headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
json=payload, stream=True)
The script extracts the first URL from remote model output and opens it automatically on the host system with no confirmation, origin validation, or scheme restrictions. Because the URL is effectively untrusted network-controlled content, this can drive users to phishing pages, trigger browser-based exploitation attempts, or invoke unsafe handlers depending on the platform.
The skill both installs a package and spawns a separate worker process, but the file provides little justification or disclosure for these capabilities. In a skill environment, hidden process creation and environment mutation increase the attack surface and can be abused for persistence, evasion, or actions outside the user's expectations.
Installing dependencies automatically via pip without warning or confirmation modifies the execution environment and may fetch code from external repositories without informed consent. That is risky in agent skills because users may not realize the skill can change the host system or pull in unreviewed third-party code.
Automatically running pip install at runtime executes package-management actions without user consent and relies on external package sources, which can introduce supply-chain risk or unexpected environment modification. In an agent skill context, silently altering the host environment is especially dangerous because it expands capability and trust boundaries during normal use.
importlib.import_module("requests")
except ImportError:
print("[*] 正在安装缺失依赖: requests...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "requests"])
def trigger_veo_generation(prompt, model="veo3.1-fast", seconds=8):
# 在触发前确保环境就绪
The code launches a background worker process and only returns a brief task-submitted message, without meaningfully disclosing what process is started, how long it may run, or what resources it may use. In a skill context, undisclosed background execution is dangerous because it can mask ongoing activity and reduce user control over local process creation.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 跨平台进程启动设置
if platform.system() == 'Windows':
# Windows 上使用 CREATE_NEW_PROCESS_GROUP
subprocess.Popen(cmd, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
else:
# Linux/macOS 上启动新进程
subprocess.Popen(cmd, start_new_session=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
subprocess.Popen(cmd, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
else:
# Linux/macOS 上启动新进程
subprocess.Popen(cmd, start_new_session=True)
return f"[*] 任务已提交: {prompt},请在聊天窗口耐心等待结果通知。"
The activation phrase is fixed to the Chinese string '生成视频:', which enforces a specific language for invocation. There is no indication in this file that alternative languages are accepted or that the language restriction is an intentional, documented locale-specific constraint.
The comment says the path is being corrected to point to scripts/veo_worker.py under the project root, but the actual code constructs a path to model/scripts/veo_worker.py. This is an active contradiction between documentation and behavior, even though it is low impact.
The script's comments and runtime status/error messages are written in Chinese only, such as task initialization and failure messages. This can constitute a language/locale policy issue when a skill imposes a specific language without user opt-in or documented locale scope.
User-facing messages and inline natural-language content are written exclusively in Chinese, including the returned status text and printed installation message. This imposes a specific language/locale without offering a user choice or documenting that the skill is intentionally region- or language-specific.
The docstring for ensure_dependencies states that necessary dependencies are automatically ensured, which implies comprehensive environment preparation. In reality, the code checks only for the 'requests' module and installs just that one package, so the documentation overstates what the function actually guarantees.
The dependency is specified as requests>=2.25.1, which allows installation of many different future or currently vulnerable versions and prevents reproducible builds. In a security context, unpinned dependencies increase supply-chain risk and make it difficult to verify whether known vulnerabilities in requests are actually excluded.
requests>=2.25.1