T09 · Insecure Skill Coding Practices
- Location
references/common-errors.md:506- Finding
Bearer Token Exposure Through Verbose HTTP Diagnostics
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a Feishu document API guide, but it asks users to set up persistent edit/delete access and includes unsafe token-handling examples that need review before use.
Install only if you are comfortable granting a Feishu self-built app document read/write permissions. Use least-privilege scopes, avoid enabling Bot capability unless needed, do not paste real app secrets or tokens into shared terminals or scripts, avoid curl verbose logging with Authorization headers, confirm targets before edits or deletes, and revoke app/document permissions when finished.
references/common-errors.md:506Bearer Token Exposure Through Verbose HTTP Diagnostics
references/common-errors.md:539Unsafe Application Secret Storage and Access Token Logging in Diagnostic Script
SKILL.md:14Mandatory Bot Capability Exceeds the Skill's Document-Editing Requirements
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**Publish app**: Submit version and publish, ensuring the app coverage includes target users/departments.
### 2. Get Access Token
Call the self-built app get tenant_access_token interface:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**Publish app**: Submit version and publish, ensuring the app coverage includes target users/departments.
### 2. Get Access Token
Call the self-built app get tenant_access_token interface:
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
接口:
DELETE /docx/v1/documents/{document_id}/blocks/{block_id}
响应示例:
The skill instructs an agent to read and modify Feishu documents but provides no user-facing warning, confirmation step, or safety boundaries around accessing potentially sensitive content or making destructive edits. In an agent context, this increases the risk of unauthorized data access, unintended exfiltration through API calls, or accidental document modification without explicit user awareness.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Call the self-built app get tenant_access_token interface:
curl -X POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal \
-H "Content-Type: application/json" \
-d '{"app_id": "your_app_id", "app_secret": "your_app_secret"}'
The guide instructs users to obtain and use app credentials and tenant access tokens, then perform API calls that read and modify document contents, but it does not include any privacy or credential-handling warning. In markdown documentation, operations involving sensitive tokens and access to user data should disclose those risks clearly.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
获取 token:
curl -X POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal \
-H "Content-Type: application/json" \
-d '{"app_id": "your_app_id", "app_secret": "your_app_secret"}'
This markdown file documents a block deletion endpoint and later provides a direct delete workflow, but it does not warn users that the operation removes document content and may be irreversible. For markdown files, destructive behaviors that can affect user data should be accompanied by clear warnings.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 假设 document_id = "ABC123"
# 3. 写入内容
curl -X POST "https://open.feishu.cn/open-apis/docx/v1/documents/ABC123/blocks/ABC123/children" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
-H "Authorization: Bearer $TOKEN" | jq '.data.items[0].block_id'
# 2. 更新块内容
curl -X PATCH "https://open.feishu.cn/open-apis/docx/v1/documents/ABC123/blocks/BLOCK_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# ❌ 错误示例
curl -X POST "https://open.feishu.cn/open-apis/..." \
-H "Content-Type: application/json" \
-d '{"..."}'
The verbose curl debugging example encourages inspecting Authorization headers directly, which can leak bearer tokens into terminal scrollback, CI logs, shell history capture, and support artifacts. Because bearer tokens grant API access, disclosure can enable unauthorized document access or modification until expiry.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 1. 重新获取 token
curl -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json" \
-d '{
"app_id": "your_app_id",
The guide includes concrete examples that use app credentials and tokens in shell scripts and prints token material to stdout. In a troubleshooting document for an agent skill, this normalizes unsafe secret handling and increases the chance operators will expose credentials in terminals, logs, screenshots, or shared runbooks.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# - text.elements[0].text_run.content
# 3. 使用 jq 格式化 JSON
curl -X POST "URL" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d @request.json | jq .
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
EOF
curl -X POST "URL" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d @request.json
Although the transmission is to a legitimate Feishu auth endpoint, the surrounding test script embeds app credentials inline and captures token responses in shell variables for subsequent output. In practice this can leak secrets via process inspection, shell history, pasted scripts, CI logs, or shared debugging sessions.
# 1. 获取 token
echo "获取 token..."
TOKEN_RESPONSE=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json" \
-d "{\"app_id\": \"$APP_ID\", \"app_secret\": \"$APP_SECRET\"}")
The example combines authenticated outbound requests with error logging that records request bodies and responses, creating a realistic path for sensitive document data or tokens to be written to local logs. Even if the destination is legitimate, the logging pattern materially increases exposure of transmitted secrets and content.
}
# 使用示例
curl -s -X POST "URL" -H "Authorization: Bearer {token}" -d '{"..."}' || {
log_error "API 调用失败: URL"
log_error "请求体: {...}"
log_error "响应: $(curl -s ...)"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
APP_OPEN_ID="ou_xxxxxxxxx"
# 调用添加协作者 API
curl -X POST "https://open.feishu.cn/open-apis/docx/v1/documents/{document_id}/permissions/permission" \
-H "Authorization: Bearer {tenant_access_token}" \
-H "Content-Type: application/json" \
-d '{
The guide shows how to request a tenant_access_token using app_id and app_secret, but it does not warn readers to treat those values and the returned token as secrets. In practice, users often paste such commands into shared terminals, CI logs, screenshots, or documentation, which can expose credentials that allow unauthorized API access to Feishu resources.
The skill content appears to require Chinese comprehension and does not offer an alternative language or note that the material is intentionally Chinese-only. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.
SQP-3 applies to all file types and covers natural-language policy violations such as forcing a specific language without user opt-in. This guide presents all instructions in Chinese and does not indicate that the language is optional or justified by a region-specific constraint.
No suspicious patterns detected.