T09 · Insecure Skill Coding Practices
- Location
scripts/package_skill.py:47- Finding
Credential File Is Included in Generated Skill Archives
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s document-reading purpose is coherent, but it needs Review because its integration and packaging guidance can expose credentials or enable unsafe command execution.
Install only if you are comfortable giving the skill a Feishu app ID/secret and letting it print retrieved Feishu content into your agent session or logs. Use the smallest Feishu permissions possible, avoid recursive wiki reads unless needed, do not follow the exec interpolation example with untrusted input, and do not package or share a configured copy unless credential files are removed first.
scripts/package_skill.py:47Credential File Is Included in Generated Skill Archives
USAGE_EXAMPLES.md:91Shell Command Injection in Documented AI-Agent Integration
requirements.txt:2Unpinned Runtime Dependency Allows Unreviewed Future Artifacts
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Large documents**: The full blocks structure can be large; consider using `--format simple` for just text
- **Rate limiting**: Feishu API has rate limits; implement caching when possible
- **Token expiration**: Access tokens expire after 2 hours; the script handles automatic refresh
### 6. Security Best Practices
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Large documents**: The full blocks structure can be large; consider using `--format simple` for just text
- **Rate limiting**: Feishu API has rate limits; implement caching when possible
- **Token expiration**: Access tokens expire after 2 hours; the script handles automatic refresh
### 6. Security Best Practices
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
If companion code authenticates, validates credentials, or prints token fragments while the skill is described only as a content reader, that is a meaningful security mismatch because it introduces secret-handling behavior not clearly disclosed to users. Undocumented token handling increases the chance of accidental exposure in logs, transcripts, or debugging output.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Secure credential storage**: Supports both environment variables and secure file storage
- **No credential logging**: Credentials never appear in logs or output
- **Minimal permissions**: Uses only required API permissions
- **Access token caching**: Efficient token reuse to minimize API calls
## Command Line Options
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp reference/feishu_config_sample.json reference/feishu_config.json
chmod 600 reference/feishu_config.json
编辑 reference/feishu_config.json,填入你的 app_id 和 app_secret。
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp reference/feishu_config_sample.json reference/feishu_config.json
chmod 600 reference/feishu_config.json
编辑 reference/feishu_config.json,填入你的 app_id 和 app_secret。
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cp reference/feishu_config_sample.json reference/feishu_config.json
chmod 600 reference/feishu_config.json
编辑 reference/feishu_config.json,填入你的 app_id 和 app_secret。
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
### 6. Security Best Practices
- Never log or expose app secrets
- Use file permissions (`chmod 600`) on config files
- Validate document tokens before processing
- Implement proper error handling to avoid information leakage
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
### 6. Security Best Practices
- Never log or expose app secrets
- Use file permissions (`chmod 600`) on config files
- Validate document tokens before processing
- Implement proper error handling to avoid information leakage
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
### 6. Security Best Practices
- Never log or expose app secrets
- Use file permissions (`chmod 600`) on config files
- Validate document tokens before processing
- Implement proper error handling to avoid information leakage
The README promotes reading Feishu documents, spreadsheets, bitables, and wiki content and even highlights AI-agent integration, but it does not clearly warn users that the tool may retrieve and print sensitive business data to stdout or downstream systems. In agent or pipeline contexts, this omission increases the chance of accidental data exposure through logs, chat transcripts, or untrusted tool consumers.
The skill declares no explicit tool scope even though the documented behavior clearly requires network access, filesystem reads, and likely environment/config access for credentials. In an agent environment, missing scope declarations can cause overbroad execution or prevent users and policy engines from understanding that the skill can access local secrets and exfiltrate document data over the network.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 获取tenant_access_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"}'
The script’s docstrings, CLI descriptions, help text, logs, and error messages are all written in Chinese, which imposes a specific language on users without opt-in or alternative locale support. This matches the language/locale policy violation category because the skill does not offer a language choice or document a justified region-specific constraint.
The skill description says it reads Feishu documents, but this code also supports enumerating an entire Wiki space and, when recursive mode is enabled, extracting content from many child nodes automatically. That materially expands the data-access scope from a single requested document to potentially large collections of sensitive documents, increasing the risk of unintended bulk disclosure.
The recursive Wiki-space read path can retrieve and output large amounts of content without any user-facing warning about scope, sensitivity, or volume. In a document-reader skill, this makes accidental over-collection and disclosure of confidential enterprise knowledge more likely, especially when output is serialized as JSON for downstream handling.
This shell script presents usage, warnings, and error messages exclusively in Chinese, which imposes a specific language on users without opt-in. That matches the language/locale policy violation category because the file does not indicate that the skill is intentionally region-specific or provide an alternative language.
This file contains user-facing and descriptive text in Chinese, including the module docstring and function docstrings, with no indication that the skill is intentionally limited to Chinese-speaking users. The policy requires avoiding forced language or locale constraints unless the skill offers opt-in or clearly documents and justifies the locale restriction.
This shell script requires app_id and app_secret in a configuration file, then invokes Python readers to access Feishu documents. Although usage is documented, there is no explicit disclosure that running the script will use stored credentials and perform remote API access that may retrieve potentially sensitive document data.
No suspicious patterns detected.