T09 · Insecure Skill Coding Practices
- Location
scripts/audit.py:163- Finding
Sensitive Scan Findings Are Transmitted to an External AI Service Without Redaction
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent security scanner, but its default AI mode can send sensitive scan findings and source snippets to an external AI endpoint without redaction or confirmation.
Review this skill carefully before installing. Use --no-ai for sensitive or proprietary repositories unless you explicitly want findings sent to an AI provider. If AI analysis is used, assume matched source snippets, possible secrets, local paths, and the configured API credential may be sent to the selected base URL; avoid custom base URLs unless you trust and control the endpoint.
scripts/audit.py:163Sensitive Scan Findings Are Transmitted to an External AI Service Without Redaction
scripts/audit.py:160Unrestricted AI Base URL Can Receive the API Key and Sensitive Findings
scripts/audit.py:163Untrusted Repository Content Is Embedded in the AI Instruction Prompt
scripts/audit.py:147AI Mode Relies on an Undeclared and Unpinned Runtime Dependency
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).
"Unsafe Pickle Load": re.compile(r'pickle\.loads?\s*\('),
"Unsafe YAML Load": re.compile(r'yaml\.load\s*\(.*Loader=.*FullLoader'),
"Hardcoded Admin Credentials": re.compile(r'(?i)(admin|root)\s*[=:]\s*["\']?(admin|password|123456)["\']?'),
"Insecure File Permissions - chmod 777": re.compile(r'chmod\s+777|os\.chmod\s*\(.*0o?777'),
"Debug Mode Enabled": re.compile(r'(?i)debug\s*=\s*True'),
"CORS Wildcard": re.compile(r'(?i)Access-Control-Allow-Origin.*\*'),
"Insecure HTTPS Disable": re.compile(r'(?i)(verify\s*=\s*False|ssl_verify.*false|disable_ssl)'),
Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.
"Unsafe YAML Load": re.compile(r'yaml\.load\s*\(.*Loader=.*FullLoader'),
"Hardcoded Admin Credentials": re.compile(r'(?i)(admin|root)\s*[=:]\s*["\']?(admin|password|123456)["\']?'),
"Insecure File Permissions - chmod 777": re.compile(r'chmod\s+777|os\.chmod\s*\(.*0o?777'),
"Debug Mode Enabled": re.compile(r'(?i)debug\s*=\s*True'),
"CORS Wildcard": re.compile(r'(?i)Access-Control-Allow-Origin.*\*'),
"Insecure HTTPS Disable": re.compile(r'(?i)(verify\s*=\s*False|ssl_verify.*false|disable_ssl)'),
"Weak Hash - MD5": re.compile(r'(?i)hashlib\.md5\('),
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
# 需要扫描的文件扩展名
SCAN_EXTENSIONS = {'.py', '.js', '.ts', '.jsx', '.tsx', '.json', '.yaml', '.yml', '.env', '.txt', '.md', '.sh', '.bat', '.ps1', '.java', '.go', '.rs'}
# 跳过的目录
SKIP_DIRS = {'node_modules', '.git', '__pycache__', '.venv', 'venv', 'dist', 'build', '.next', '.nuxt'}
The skill advertises and requires capabilities equivalent to environment access, filesystem reads/writes, and shell execution, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity: a reviewer or runtime may not have a clear, least-privilege contract for what the skill is allowed to do, increasing the chance of overbroad execution or unsafe deployment.
The manifest description and top-level documentation are written entirely in Chinese, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific context. This can violate language/locale policy when a skill imposes a specific language without user opt-in.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
"Unsafe Pickle Load": re.compile(r'pickle\.loads?\s*\('),
"Unsafe YAML Load": re.compile(r'yaml\.load\s*\(.*Loader=.*FullLoader'),
"Hardcoded Admin Credentials": re.compile(r'(?i)(admin|root)\s*[=:]\s*["\']?(admin|password|123456)["\']?'),
"Insecure File Permissions - chmod 777": re.compile(r'chmod\s+777|os\.chmod\s*\(.*0o?777'),
"Debug Mode Enabled": re.compile(r'(?i)debug\s*=\s*True'),
"CORS Wildcard": re.compile(r'(?i)Access-Control-Allow-Origin.*\*'),
"Insecure HTTPS Disable": re.compile(r'(?i)(verify\s*=\s*False|ssl_verify.*false|disable_ssl)'),
The tool is marketed as a local security scanner, but it transmits scan findings derived from user code to an external AI service for analysis. Those findings can include snippets of source code, secrets, tokens, passwords, connection strings, or other sensitive material, creating a real data-exfiltration and confidentiality risk in a security-audit context.
Reading API credentials from environment variables and allowing outbound requests to a configurable base URL expands the tool's capability beyond basic local scanning. In this skill context, that broader capability increases the chance that sensitive findings are sent to unintended or attacker-controlled endpoints if the base URL is misconfigured or influenced by the environment.
The hardcoded default external endpoint https://api.deepseek.com/v1 confirms that the tool performs outbound transmission to a third-party service. In a code-auditing tool that may process secrets and proprietary source code, external transmission is materially sensitive even if TLS is used.
return None
if not base_url:
base_url = os.environ.get('DEEPSEEK_BASE_URL', 'https://api.deepseek.com/v1')
client = OpenAI(api_key=api_key, base_url=base_url)
The code sends issue data to the external API at the call site without a just-in-time warning or confirmation, even though the transmitted payload may contain sensitive security findings and code context. For a security audit tool, silent upload of findings undermines user expectations of confidentiality and increases accidental disclosure risk.
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
lines.append("")
lines.append("=" * 60)
lines.append(" 报告生成时间: " + __import__('datetime').datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
lines.append(" 工具: Agent Security Audit v1.0")
lines.append("=" * 60)
This manifest includes a natural-language field value in Chinese for the author name, which may create an implicit language/locale inconsistency without any documented choice or justification. Under the locale policy rule, natural-language metadata that forces or assumes a specific language can be a policy concern when no opt-in or explanation is provided.
The prompt explicitly says 请用中文回复, which forces a specific output language regardless of user preference. This is a natural-language locale policy issue because the file does not offer a language choice or explain a justified region-specific constraint.
No suspicious patterns detected.