T09 · Insecure Skill Coding Practices
- Location
scripts/skill_handler.py:59- Finding
Arbitrary Readable File Upload Through Unvalidated File Paths
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real photo-to-COS uploader, but it needs Review because crafted input or debug use can cause arbitrary readable local files to be uploaded.
Install only after the uploader is fixed to accept trusted OpenClaw attachment metadata or restrict real paths to the inbound media directory, reject symlinks, verify actual image content, and run as a dedicated low-privilege user. Use a Tencent Cloud sub-account limited to writing the intended bucket and prefix, pin dependencies, and make sure people sending images know they will be stored in COS.
scripts/skill_handler.py:59Arbitrary Readable File Upload Through Unvalidated File Paths
scripts/requirements.txt:1Mutable and Unverified Python Dependencies Installed From the Package Index
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
The skill appears to collect and store Tencent Cloud SecretId/SecretKey, validate bucket connectivity, and initialize local configuration while not implementing the user-facing upload workflow it advertises. Because cloud credentials are highly sensitive, misrepresenting a credential-harvesting/setup utility as a photo-upload helper materially increases the risk of users granting secrets without understanding the true function.
The skill appears to collect and store Tencent Cloud SecretId/SecretKey, validate bucket connectivity, and initialize local configuration while not implementing the user-facing upload workflow it advertises. Because cloud credentials are highly sensitive, misrepresenting a credential-harvesting/setup utility as a photo-upload helper materially increases the risk of users granting secrets without understanding the true function.
The skill appears to collect and store Tencent Cloud SecretId/SecretKey, validate bucket connectivity, and initialize local configuration while not implementing the user-facing upload workflow it advertises. Because cloud credentials are highly sensitive, misrepresenting a credential-harvesting/setup utility as a photo-upload helper materially increases the risk of users granting secrets without understanding the true function.
The skill appears to collect and store Tencent Cloud SecretId/SecretKey, validate bucket connectivity, and initialize local configuration while not implementing the user-facing upload workflow it advertises. Because cloud credentials are highly sensitive, misrepresenting a credential-harvesting/setup utility as a photo-upload helper materially increases the risk of users granting secrets without understanding the true function.
The README describes automatic receipt and cloud upload of WeChat photos, but does not prominently warn that user-submitted images will be transferred to Tencent COS and retained there, creating privacy and consent risk. In this skill context, the issue is more significant because the workflow is explicitly automated and triggered by inbound chat media, so operators may deploy it without informing end users whose images are being archived.
The skill advertises an executable entrypoint (run.sh) but does not declare any explicit tool scope or permission boundaries. In agent environments, undeclared shell capability increases the risk of overbroad execution, hidden side effects, and makes review harder because users cannot tell what system access the skill expects.
The skill description says image attachments from WeChat are automatically uploaded to cloud storage, but it does not clearly warn users about the privacy and data-transfer implications of that automation. Automatic exfiltration of personal images to a cloud bucket is safety-sensitive, especially when triggered by incoming messages and when users may not realize every image will be uploaded.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo "[4/5] 设置文件权限..."
chmod +x "${SKILL_DIR}/run.sh"
chmod +x "${SKILL_DIR}/install.sh"
chmod 644 "${SKILL_DIR}/scripts/skill_handler.py"
chmod 644 "${SKILL_DIR}/scripts/cos_uploader.py"
chmod 644 "${SKILL_DIR}/scripts/config.py"
chmod 644 "${SKILL_DIR}/scripts/setup_config.py"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo "[4/5] 设置文件权限..."
chmod +x "${SKILL_DIR}/run.sh"
chmod +x "${SKILL_DIR}/install.sh"
chmod 644 "${SKILL_DIR}/scripts/skill_handler.py"
chmod 644 "${SKILL_DIR}/scripts/cos_uploader.py"
chmod 644 "${SKILL_DIR}/scripts/config.py"
chmod 644 "${SKILL_DIR}/scripts/setup_config.py"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo "[4/5] 设置文件权限..."
chmod +x "${SKILL_DIR}/run.sh"
chmod +x "${SKILL_DIR}/install.sh"
chmod 644 "${SKILL_DIR}/scripts/skill_handler.py"
chmod 644 "${SKILL_DIR}/scripts/cos_uploader.py"
chmod 644 "${SKILL_DIR}/scripts/config.py"
chmod 644 "${SKILL_DIR}/scripts/setup_config.py"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo "[4/5] 设置文件权限..."
chmod +x "${SKILL_DIR}/run.sh"
chmod +x "${SKILL_DIR}/install.sh"
chmod 644 "${SKILL_DIR}/scripts/skill_handler.py"
chmod 644 "${SKILL_DIR}/scripts/cos_uploader.py"
chmod 644 "${SKILL_DIR}/scripts/config.py"
chmod 644 "${SKILL_DIR}/scripts/setup_config.py"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo "[5/5] 创建运行时目录..."
mkdir -p "${SKILL_DIR}/scripts/conf"
mkdir -p "${SKILL_DIR}/scripts/logs"
chmod 700 "${SKILL_DIR}/scripts/conf"
echo " ✅ 目录创建完成"
# ==================== 安装完成 ====================
The comments and visible runtime messages are entirely in Chinese, including the usage/help text and error output. This imposes a specific language on users without any opt-in or documented locale justification, which matches the language-policy violation criteria.
This code file contains natural-language documentation entirely in Chinese, and later user-facing runtime messages are also Chinese-only. Under the policy for natural-language violations, forcing a specific language without opt-in or a documented region-specific justification is a reportable issue.
This code performs a network upload of a local file to Tencent Cloud COS, which transmits user or system data off the local machine. Although the docstring describes the upload behavior, there is no confirmation prompt, user-facing print/log notice, or other explicit disclosure at the point of action.
Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.
if file_size <= 20 * 1024 * 1024: # 20MB 以下使用简单上传
with open(local_file_path, 'rb') as fp:
response = client.put_object(
Bucket=bucket,
Body=fp,
Key=cos_key,
Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.
)
else:
# 大文件使用分块上传
response = client.upload_file(
Bucket=bucket,
LocalFilePath=local_file_path,
Key=cos_key,
整个技能 README 仅以中文呈现,且未说明该技能是否仅面向中文用户、是否支持其他语言,或是否允许用户自行选择语言/locale。根据该规则,若存在语言/地区约束而未提供选择或合理说明,属于自然语言层面的组织策略风险。
All visible natural-language content in the skill metadata and instructions is presented only in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in can be a natural-language policy concern.
The script's user-facing description and usage text are presented in Chinese, and the remainder of the installer output continues in that language. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation when no locale choice or justification is provided.
Comments and all echoed instructions are presented in Chinese, including usage and deployment guidance. This effectively forces a specific language for users without opt-in, which matches the language/locale policy violation criteria.
The natural-language documentation in this file is entirely Chinese and does not indicate any user language choice or locale-specific justification. Under the stated policy, forcing a specific language without opt-in can be a locale-policy issue.
The dependency is specified with a lower bound only, so builds may resolve to different versions over time. This weakens supply-chain reproducibility and can unexpectedly introduce vulnerable or breaking releases into the skill environment.
cos-python-sdk-v5>=1.9.30
cryptography>=41.0.0
Using cryptography with only a minimum version means the actually installed version is not controlled or reproducible. Because this is a security-sensitive package, version drift increases the chance of pulling in a release with known issues or incompatible bundled components.
cos-python-sdk-v5>=1.9.30
cryptography>=41.0.0