T09 · Insecure Skill Coding Practices
- Location
scripts/upload_image.py:46- Finding
Feishu application secret exposed through plaintext documentation and command-line arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is for Feishu card messaging and its network behavior is mostly purpose-aligned, but it gives unsafe guidance for handling Feishu app secrets.
Review before installing. Use this only with a Feishu app restricted to the minimum required permissions, and do not store the App Secret in USER.md or pass it on the command line. Prefer a protected secret mechanism or tightly scoped environment variable, avoid uploading sensitive images or message content unless approved, and rotate the App Secret if it has already been placed in documentation, shell history, logs, or shared agent context.
scripts/upload_image.py:46Feishu application secret exposed through plaintext documentation and command-line arguments
The documented behavior is inconsistent: the description says the skill uses the message tool with a card parameter, but the findings indicate direct Feishu API usage and undeclared image-upload behavior. This mismatch undermines user trust and reviewability, because operators may approve a simple messaging skill while it actually performs different external actions and credential-handling flows.
The skill declares no explicit tool scope or permissions while its documented workflow implies access to credentials, external network calls, and image upload behavior. Missing scope declarations make it harder to constrain what the skill may access or transmit, increasing the risk of over-privileged execution or unintended data exposure.
The skill encourages sending messages and uploading images to Feishu but does not warn users that message content and media will leave the local environment and be transmitted to an external service. This can cause accidental disclosure of sensitive text, images, or metadata when users assume the action is local or insufficiently understand the data-sharing implications.
The skill instructs users to place a Feishu App Secret in configuration without any guidance on secure secret storage, least exposure, or rotation. That creates a realistic risk of credential leakage through plaintext files, logs, screenshots, repository commits, or broader agent access to the configuration.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
headers = {"Content-Type": "application/json; charset=utf-8"}
data = {"app_id": app_id, "app_secret": app_secret}
resp = requests.post(url, headers=headers, json=data)
result = resp.json()
if result.get("code") != 0:
This code performs a network transmission of user-provided file data to an external service, but the script does not present any confirmation prompt or explicit user-facing warning at runtime beyond the generic argument descriptions. For code files, network calls that transmit user data should have some visible disclosure unless clearly covered by the skill description, which is not present here.
The module docstring and CLI help text are written in Chinese, which imposes a single language for user-facing interaction without any opt-in or alternative. The policy specifically calls out language or locale constraints as violations when they are forced without user choice or clear justification.
The code accesses FEISHU_APP_ID and FEISHU_APP_SECRET from the environment, which are sensitive values, but only includes a brief internal comment and no user-facing notice. Under this rule, sensitive environment variable access should have visible disclosure in code comments/docstrings or runtime messaging unless already clearly documented elsewhere.