T09 · Insecure Skill Coding Practices
- Location
src/crypto_utils.py:7- Finding
API Credentials Are Protected with a Public, Deterministic Encryption Key
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This document-translation skill appears functional, but it needs review because it can send document text to cloud providers and leaves sensitive local metadata and temporary files behind.
Install only if you are comfortable with document text being processed by selected cloud providers when cloud mode is used. Prefer local Ollama mode for sensitive files, use an isolated virtual environment, avoid committing generated monitor or summary files, delete tmp conversion files after use, and do not rely on the bundled API-key encryption as strong credential protection.
src/crypto_utils.py:7API Credentials Are Protected with a Public, Deterministic Encryption Key
requirements.txt:1All Third-Party Dependencies Are Installed Without Version or Integrity Pinning
src/file_handler.py:55PDF Conversion Uses Predictable Temporary Files Without Cleanup
translation_monitor.py:12Translation Monitoring Persists Sensitive File Metadata in Plaintext
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
*.log
# Environment files
.env
.env.*
!.env.example
The skill promotes cloud translation engines but does not clearly warn that document contents will be transmitted to third-party model providers. Because the tool handles potentially sensitive PDFs, Word, Excel, and PPT files, lack of upfront disclosure can lead to unintended exfiltration of confidential content outside the local environment.
The skill advertises capabilities that read files, write outputs, and use environment-provided API keys, but it does not declare an explicit tool scope or permission boundary. That increases the chance the agent will invoke file and secret-adjacent operations without clear user-visible constraints, especially in environments where skill permissions are expected to gate access.
The invocation phrases are broad enough to match ordinary translation requests, so the skill may be triggered when a user only wanted simple text translation rather than file processing. In context, this matters because invocation can cause local file access and possible cloud upload of document contents, making accidental activation more harmful than a harmless routing mistake.
The skill appears to automatically apply Chinese-specific formatting and keyword extraction behaviors without explicit user consent. In context this can alter document meaning, styling, or compatibility unexpectedly, and keyword extraction itself may process sensitive content beyond what users expect from a straightforward translation task.
The skill describes smart monitoring and process recording without warning users that translation activity and document-related metadata may be logged. Even if full document bodies are not always stored, operational records about filenames, timing, languages, models, and excerpts can expose sensitive business or personal information.
The monitoring instructions say every translation is fully recorded, creating a data retention risk for user-provided document contents or content-derived metadata. In a document-translation skill, the context makes this especially sensitive because inputs may contain contracts, financial data, legal text, or personal information.
The skill explicitly states that all translation records are stored in a persistent JSON file, which creates an ongoing local data exposure risk. Persistent logs are easy to copy, inspect, back up, or leak, and they may reveal sensitive document names, processing details, and potentially excerpts or analysis artifacts over time.
This Python file contains natural-language docstrings and all user-facing print output exclusively in Chinese, including the title, status messages, and recommendations. Under the policy rules, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
This file contains natural-language instructions and examples exclusively in Chinese, which can amount to forcing a specific language on users without opt-in. The policy allows locale constraints only when user choice is offered or the restriction is clearly documented and justified, neither of which appears here.
The entire markdown file presents the skill content exclusively in Chinese, including the title, section headings, comments, and explanatory bullets. Under the policy rule, forcing a specific language without an explicit user choice or documented justification is a natural-language policy violation.
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
def check_package(package_name):
"""检查单个包是否已安装"""
try:
__import__(package_name)
return True
except ImportError:
return False
The string literal on L30 hard-codes the generated context prompt in English ('The text contains...' / 'Please ensure...'). This imposes a specific language on downstream behavior without user opt-in, which matches the language/locale policy violation criteria.
This plain-text config sets TARGET_LANG=zh-CN as a global default, but the file provides no surrounding activation context or constraints explaining when this locale-specific behavior should apply. In a broadly applicable translation skill, a fixed default target language can overlap with many general translation requests and is not narrowed by explicit scope or negative examples.
The natural-language configuration sets TARGET_LANG=zh-CN, which imposes a specific locale by default. There is no indication in this file that users are offered a language choice or have explicitly opted into Chinese output, making it a language-policy concern.
The configuration includes multiple cloud translation endpoints but provides no in-file indication that translated content may be transmitted to third-party services. If users process sensitive documents, they may unknowingly send proprietary or personal data off-host, creating confidentiality and compliance risk.
The top-level documentation describes this module as a configuration loader that reads from config.txt, which implies read-oriented behavior. However, importing the module triggers os.makedirs on the output and temporary directories at L132-L136, introducing filesystem-modifying side effects not reflected by the docstring.
The configuration hard-codes a default target locale of "zh-CN", which forces a specific language/locale choice unless the user overrides it. This is a natural-language policy issue because the file does not indicate user choice, opt-in, or a documented region-specific justification for the default locale.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"env_key": raw_config.get("CLOUD_MODEL_DEEPSEEK_ENV_KEY", "DEEPSEEK_API_KEY")
},
"GPT-4o": {
"base_url": raw_config.get("CLOUD_MODEL_GPT4O_BASE_URL", "https://api.openai.com/v1"),
"model": raw_config.get("CLOUD_MODEL_GPT4O_MODEL", "gpt-4o"),
"env_key": raw_config.get("CLOUD_MODEL_GPT4O_ENV_KEY", "OPENAI_API_KEY")
},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"env_key": raw_config.get("CLOUD_MODEL_DEEPSEEK_ENV_KEY", "DEEPSEEK_API_KEY")
},
"GPT-4o": {
"base_url": raw_config.get("CLOUD_MODEL_GPT4O_BASE_URL", "https://api.openai.com/v1"),
"model": raw_config.get("CLOUD_MODEL_GPT4O_MODEL", "gpt-4o"),
"env_key": raw_config.get("CLOUD_MODEL_GPT4O_ENV_KEY", "OPENAI_API_KEY")
},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"env_key": raw_config.get("CLOUD_MODEL_GPT4O_ENV_KEY", "OPENAI_API_KEY")
},
"Claude 3.5 Sonnet": {
"base_url": raw_config.get("CLOUD_MODEL_CLAUDE_BASE_URL", "https://api.anthropic.com/v1"),
"model": raw_config.get("CLOUD_MODEL_CLAUDE_MODEL", "claude-3-5-sonnet-20240620"),
"env_key": raw_config.get("CLOUD_MODEL_CLAUDE_ENV_KEY", "ANTHROPIC_API_KEY")
},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"env_key": raw_config.get("CLOUD_MODEL_GPT4O_ENV_KEY", "OPENAI_API_KEY")
},
"Claude 3.5 Sonnet": {
"base_url": raw_config.get("CLOUD_MODEL_CLAUDE_BASE_URL", "https://api.anthropic.com/v1"),
"model": raw_config.get("CLOUD_MODEL_CLAUDE_MODEL", "claude-3-5-sonnet-20240620"),
"env_key": raw_config.get("CLOUD_MODEL_CLAUDE_ENV_KEY", "ANTHROPIC_API_KEY")
},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"env_key": raw_config.get("CLOUD_MODEL_CLAUDE_ENV_KEY", "ANTHROPIC_API_KEY")
},
"SiliconFlow (Qwen2.5)": {
"base_url": raw_config.get("CLOUD_MODEL_SILICONFLOW_BASE_URL", "https://api.siliconflow.cn/v1"),
"model": raw_config.get("CLOUD_MODEL_SILICONFLOW_MODEL", "deepseek-ai/DeepSeek-V3"),
"env_key": raw_config.get("CLOUD_MODEL_SILICONFLOW_ENV_KEY", "SILICONFLOW_API_KEY")
},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"env_key": raw_config.get("CLOUD_MODEL_CLAUDE_ENV_KEY", "ANTHROPIC_API_KEY")
},
"SiliconFlow (Qwen2.5)": {
"base_url": raw_config.get("CLOUD_MODEL_SILICONFLOW_BASE_URL", "https://api.siliconflow.cn/v1"),
"model": raw_config.get("CLOUD_MODEL_SILICONFLOW_MODEL", "deepseek-ai/DeepSeek-V3"),
"env_key": raw_config.get("CLOUD_MODEL_SILICONFLOW_ENV_KEY", "SILICONFLOW_API_KEY")
},
This code file performs file-system writes by creating the configured output and temporary directories as soon as the module is imported. Although there are comments, they are implementation notes rather than user-facing warnings, and there is no confirmation, logging, or explicit disclosure that importing the skill will modify the local filesystem.
No suspicious patterns detected.