T09 · Insecure Skill Coding Practices
- Location
scripts/sync-feishu-wiki.sh:30- Finding
Feishu application secret exposed through process arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a legitimate knowledge-base sync purpose, but its scripts can publish arbitrary local files to Feishu or GitHub without strong scoping or confirmation.
Install only if you trust the workflow and will run it manually with reviewed inputs. Use least-privileged Feishu and GitHub credentials, restrict it to intended kb-templates files and approved repositories/wiki spaces, preview content before publishing, and avoid running it in shared or logged environments until credential handling is improved.
scripts/sync-feishu-wiki.sh:30Feishu application secret exposed through process arguments
scripts/create-github-issue.sh:32GitHub token exposed through process arguments
scripts/sync-feishu-wiki.sh:15Arbitrary readable local files can be uploaded to Feishu Wiki
scripts/create-github-issue.sh:15Arbitrary readable local files can be published as GitHub issue bodies
The skill advertises a full multilingual synchronization pipeline, but the documented behavior is largely procedural guidance and delegates critical actions to external scripts without demonstrating the claimed translation, validation, GitHub orchestration, or end-to-end sync controls. This mismatch can mislead operators into granting trust or broad access under false assumptions, increasing the chance of unsafe execution or unintended data publication.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# create-github-issue.sh <repo> <title> <body-file>
#
# Environment:
# GITHUB_TOKEN — GitHub personal access token (required if gh not authed)
#
# Requirements: gh (GitHub CLI) or curl + jq
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# create-github-issue.sh <repo> <title> <body-file>
#
# Environment:
# GITHUB_TOKEN — GitHub personal access token (required if gh not authed)
#
# Requirements: gh (GitHub CLI) or curl + jq
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# create-github-issue.sh <repo> <title> <body-file>
#
# Environment:
# GITHUB_TOKEN — GitHub personal access token (required if gh not authed)
#
# Requirements: gh (GitHub CLI) or curl + jq
On authentication failure, the script prints the full token response to stderr, and such responses can include sensitive diagnostic or token material depending on API behavior. In CI logs, agent traces, or shared terminals, this can leak credentials or internal error details to unintended viewers.
TOKEN=$(echo "$TOKEN_RESP" | jq -r '.tenant_access_token')
if [[ -z "$TOKEN" || "$TOKEN" == "null" ]]; then
echo "Error: failed to get tenant access token: $TOKEN_RESP" >&2
exit 1
fi
The skill instructs the agent to run shell commands that can modify local files, push to GitHub, and invoke external sync scripts, but it does not declare any explicit tool scope or allowed-tools boundaries. This creates an authorization gap where a caller or downstream agent may execute powerful side-effecting operations without clear least-privilege constraints or review expectations.
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/auth/v3/tenant_access_token/internal \
-H "Content-Type: application/json" \
-d '{"app_id":"<APP_ID>","app_secret":"<APP_SECRET>"}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Environment:
# GITHUB_TOKEN — GitHub personal access token (required if gh not authed)
#
# Requirements: gh (GitHub CLI) or curl + jq
set -euo pipefail
The script reads arbitrary contents from BODY_FILE and transmits them to https://api.github.com/repos/$REPO/issues, creating an external data egress path. In the context of a knowledge-base sync skill, this can leak sensitive internal template text, customer support content, or embedded secrets if untrusted or overly broad files are provided as input.
-H "Content-Type: application/json" \
-d "$(jq -n --arg t "$TITLE" --arg b "$BODY" \
'{title: $t, body: $b, labels: ["documentation", "i18n"]}')" \
"https://api.github.com/repos/$REPO/issues" | jq -r '.html_url'
fi
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fi
# --- 1. Get tenant access token ---
TOKEN_RESP=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d "{\"app_id\":\"${FEISHU_APP_ID}\",\"app_secret\":\"${FEISHU_APP_SECRET}\"}")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
parent_node_token: ($parent | select(. != "") // empty)
}')
CREATE_RESP=$(curl -s -X POST 'https://open.feishu.cn/open-apis/wiki/v2/spaces/.../nodes' \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d "$CREATE_PAYLOAD")
The script reads an arbitrary local file and uploads its full contents to Feishu without any confirmation, allowlist, or classification check. In an agent skill context, this is risky because a user or downstream automation could unintentionally sync sensitive local files to an external SaaS platform, causing data exfiltration.
This request transmits the complete local file content to Feishu, which is an external data transfer and the core risky behavior in the script. In an agent skill that may operate on user-provided paths or automation inputs, this can leak sensitive files to an external service without sufficient guardrails or user acknowledgement.
index: 0
}')
curl -s -X POST "https://open.feishu.cn/open-apis/docx/v1/documents/${OBJ_TOKEN}/blocks/${OBJ_TOKEN}/children" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d "$BLOCKS_PAYLOAD" | jq .
This markdown file includes a concrete curl example that sends app_id and app_secret to an authentication endpoint, but it provides no accompanying warning about using sensitive credentials or avoiding exposure in shell history and shared terminals. Under the markdown-specific warning criterion, examples involving credentials should disclose privacy or security implications when omitted entirely.
The script requires FEISHU_APP_ID and FEISHU_APP_SECRET and uses them to obtain an access token for API calls. Although this is functionally necessary, the file only lists the variables and does not include any warning or guidance that these are sensitive credentials or should be protected.
No suspicious patterns detected.