T09 · Insecure Skill Coding Practices
- Location
scripts/send_media.py:334- Finding
Bearer Access Token Exposed in the Media Upload URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a disclosed DingTalk file-sending helper, not a hidden data stealer, but users should verify the file, recipient, and account before using it.
Install only if you want an agent to send local files through DingTalk. Before each use, confirm the exact file path, recipient or group ID, and DingTalk account, especially in multi-account environments. Avoid sending sensitive files unless necessary, use a least-privilege DingTalk app, and do not share unredacted environment or log output containing DINGTALK credentials.
scripts/send_media.py:334Bearer Access Token Exposed in the Media Upload URL
README.md:115Troubleshooting Guidance May Print the DingTalk Client Secret
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
OpenClaw 会在启动时自动加载此文件中的环境变量。
# ~/.openclaw/.env
DINGTALK_CLIENTID=dingxxxxxx
DINGTALK_CLIENTSECRET=your_secret
DINGTALK_ROBOTCODE=dingxxxxxx # 可选,默认同 clientId
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置
- `获取 access token 失败`:检查 `clientId` / `clientSecret`
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置
- `获取 access token 失败`:检查 `clientId` / `clientSecret`
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置
- `获取 access token 失败`:检查 `clientId` / `clientSecret`
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置
- `获取 access token 失败`:检查 `clientId` / `clientSecret`
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置
- `获取 access token 失败`:检查 `clientId` / `clientSecret`
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置
- `获取 access token 失败`:检查 `clientId` / `clientSecret`
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`
The README describes how to send local files to DingTalk but does not clearly warn users that the selected file contents and recipient identifiers will be transmitted to an external service. In an agent skill context, this omission can cause unintended data disclosure because a user may not realize that local screenshots, recordings, or attachments are leaving the host environment.
The skill instructs execution of a local Python script that can read local files, access environment/configured credentials, and send data over the network, but it declares no explicit tool scope or permissions boundary. That creates a confused-deputy risk: an agent may invoke file/network-capable behavior without a machine-readable restriction layer, increasing the chance of unauthorized file exfiltration to DingTalk if user intent or context is misinterpreted.
The script reads ambient configuration and credential sources from the user's environment and home directory to discover DingTalk accounts, which expands its authority beyond the narrowly stated purpose of sending a user-specified local file to a clearly intended DingTalk conversation. In an agent setting, this can cause data to be sent using unintended accounts or hidden credentials without explicit user confirmation, increasing the risk of cross-account data leakage.
The account-selection logic can derive the effective DingTalk account from OPENCLAW_ACCOUNT_ID, OPENCLAW_AGENT_ID, bindings, agent-name suffixes, connector defaults, and other runtime state rather than only from explicit operator intent. In a multi-account environment, this creates a real risk that sensitive files are transmitted through the wrong tenant, bot, or organizational context, which is especially dangerous for a file-sending skill.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def get_access_token(client_id, client_secret):
"""获取钉钉 access token"""
url = "https://api.dingtalk.com/v1.0/oauth2/accessToken"
data = json.dumps({
'appKey': client_id,
'appSecret': client_secret
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def get_access_token(client_id, client_secret):
"""获取钉钉 access token"""
url = "https://api.dingtalk.com/v1.0/oauth2/accessToken"
data = json.dumps({
'appKey': client_id,
'appSecret': client_secret
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def get_access_token(client_id, client_secret):
"""获取钉钉 access token"""
url = "https://api.dingtalk.com/v1.0/oauth2/accessToken"
data = json.dumps({
'appKey': client_id,
'appSecret': client_secret
This code uploads the specified local file to DingTalk and then sends it to a user or group via remote HTTP APIs, but the normal execution path provides no confirmation prompt or user-facing disclosure before transmission. Aside from debug-only output, there is no visible runtime warning about network transfer of potentially sensitive file data and recipient identifiers.
The top-level natural-language documentation and usage descriptions in this file are written exclusively in Chinese, which imposes a specific language on users and maintainers without any opt-in or explanation. Under the stated policy, language constraints should either be optional for the user or clearly justified as region-specific.