T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/store_kb.py:649- Finding
Unrestricted Local File Ingestion Can Exfiltrate Sensitive Data to IMA
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent, but it automatically sends user content, arbitrary local file contents, and fetched web content to Tencent IMA with broad local and network access.
Review before installing. Use this only for content you are willing to store in Tencent IMA and in the local workspace/memory. Do not pass secrets, private keys, browser profiles, internal documents, or arbitrary absolute paths. Avoid untrusted URLs unless the runtime blocks private, loopback, and metadata-network destinations, and protect or relocate the YouTube cookie file before use.
scripts/store_kb.py:649Unrestricted Local File Ingestion Can Exfiltrate Sensitive Data to IMA
scripts/store_kb.py:265Unvalidated Web Fetching Enables SSRF and Internal Data Relay
scripts/store_kb.py:142Predictable Shared Temporary Files Permit Subtitle Substitution and Symlink Abuse
The documented purpose does not accurately match the described behavior, including undisclosed handling paths and global index rebuilding. When a skill performs more than users and reviewers expect, it weakens informed consent and security review, and can hide side effects such as additional data processing, persistence, or cross-workspace modification.
Referenced artifact was not completely inspected
> ⚠️ **知识库 ID 配置**:请在 `scripts/store_kb.py` 顶部的 `IMA_KB_ID` 变量中设置目标知识库 ID。
Referenced artifact was not completely inspected
> ⚠️ **知识库 ID 配置**:请在 `scripts/store_kb.py` 顶部的 `IMA_KB_ID` 变量中设置目标知识库 ID。
The skill documentation describes capabilities to read local files, write to workspace and memory, invoke shell commands, and access external services, but it declares no explicit tool scope or permission boundaries. In an agent environment, this makes the effective authority opaque and increases the chance of unintended file access, command execution, or network exfiltration when the skill is triggered.
The skill supports local file paths and states it will read file contents and store them, but it does not present a prominent warning to users. In an agent setting, a user may casually reference a path without realizing the file will be read, copied into local knowledge stores, and potentially uploaded to an external service, which can expose sensitive filesystem data.
The skill expands from simple knowledge-base ingestion into shell-driven media extraction using yt-dlp, cookies, and local transcription tooling. That broader operational scope increases attack surface because untrusted URLs can drive external command execution, temporary file handling, and authenticated scraping behavior beyond what users may reasonably expect from the skill name and description.
The skill defaults to uploading user-provided content to an external IMA knowledge base without a clear warning or opt-in at the point of use. This creates a real data-exfiltration and privacy risk, especially if users pass sensitive notes, internal documents, or local file contents assuming the action is only local archiving.
The skill uses browser-exported YouTube cookies to perform subtitle extraction, but the user-facing behavior does not prominently warn that authenticated browser state is being reused. This is sensitive because cookies can grant account-linked access and create privacy, account security, and compliance issues if users do not realize they are enabling authenticated scraping.
This function is the central exfiltration path that sends user-provided notes, fetched web content, and local file contents to an external IMA API using stored credentials. In this skill context, external transmission is expected as a feature, but it becomes a true vulnerability because the implementation does not enforce explicit consent, data minimization, or sensitive-content safeguards before transmitting potentially private local material.
if not IMA_CLIENT_ID or not IMA_API_KEY:
return None, "IMA凭证未配置"
try:
resp = requests.post(
f"https://ima.qq.com/{path}",
headers={
"ima-openapi-clientid": IMA_CLIENT_ID,
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
if not IMA_CLIENT_ID or not IMA_API_KEY:
return None, "IMA凭证未配置"
try:
resp = requests.post(
f"https://ima.qq.com/{path}",
headers={
"ima-openapi-clientid": IMA_CLIENT_ID,
The manifest describes a unified knowledge-base ingestion flow for supported content types, but this implementation shells out to another skill's exporter for WeChat content and elsewhere to yt-dlp/node and an index rebuild script. Spawning subprocesses is not an obvious requirement of a KB entry skill itself and expands execution capability beyond simple ingestion/storage behavior.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
output_dir = "/tmp/kb_wechat"
os.makedirs(output_dir, exist_ok=True)
try:
result = subprocess.run(
["python3", script, url, output_dir],
capture_output=True, text=True, timeout=30
)
The manifest enumerates supported inputs as WeChat articles, generic web links, YouTube videos, plain text, and file paths. The implementation adds special-case handling for X/Twitter URLs, fetches their contents, and stores them, which is broader behavior than the stated supported scope.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=120)
if result.returncode != 0:
return None, f"yt-dlp 失败: {result.stderr[-500:]}"
The skill fetches remote webpage/X content and then forwards the retrieved content into IMA notes without a clear user warning that third-party content will be collected, transformed, and stored on another remote platform. This creates privacy, compliance, and data-handling risk, especially if the fetched pages contain personal data, copyrighted text, or content behind user-authenticated contexts.
For file inputs, the skill reads local file contents and uploads the extracted text to the remote IMA service without any explicit confirmation, redaction step, or policy check. In a local-agent context this is dangerous because users may supply sensitive internal documents, source code, credentials, or personal data expecting local indexing, but the skill silently transmits the contents off-host.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
try:
import subprocess
rebuild_script = "/home/xdl/.openclaw/workspace/scripts/rebuild_kb_index.py"
result = subprocess.run(["python3", rebuild_script],
capture_output=True, text=True, timeout=30)
if result.returncode == 0:
result_msg.append("KB索引: ✅ 已更新")
The manifest describes content ingestion and storage flows, but does not mention credential access or environment-variable usage. While credentials may be operationally necessary for IMA integration, accessing environment variables is a capability beyond the user-facing purpose as written.
generate_summary produces fixed Traditional Chinese section headings such as 影片來源, 頻道, and 內容摘要, and the script generally emits Chinese-language user-facing text. This imposes a locale/language choice in natural-language output without any opt-in or configuration path for users who may expect another language.
The manifest says YouTube is supported with subtitle extraction, followed by IMA storage, workspace archival, and memory recording. The implementation additionally generates a derived summary, stores both summary and full transcript as separate IMA notes and local files, which is a materially broader output behavior than the declared description.
The manifest describes automatic download, IMA storage, workspace/kb archival, and memory recording. After those steps, the code also executes a separate script to rebuild a KB master index, adding an additional side effect not reflected in the declared behavior.