T09 · Insecure Skill Coding Practices
- Location
scripts/fortune.sh:11- Finding
Overbroad credential loading and bearer-token disclosure through a configurable API endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a coherent AI fortune-telling tool, but it handles personal birth data and API credentials with under-scoped network and local-file behavior that users should review before installing.
Install only if you are comfortable sharing names, birth details, questions, and generated prompts with MiniMax. Avoid placing unrelated secrets in $HOME/.clawd/.env, do not set MINIMAX_API_HOST to an untrusted endpoint, and treat the generated fortune outputs as entertainment rather than reliable advice. Review or patch the scripts before standalone use if you need strong privacy or local multi-user safety.
scripts/fortune.sh:11Overbroad credential loading and bearer-token disclosure through a configurable API endpoint
scripts/kline_generator.py:159Predictable user-controlled temporary files permit symlink overwrite and data exposure
The request destination is derived from the MINIMAX_API_HOST environment variable and then used directly in urllib.request.urlopen. If an attacker can influence the environment, they can redirect the bearer token and submitted user data to an attacker-controlled host, causing credential exfiltration and unauthorized outbound requests; the skill context increases risk because it handles personal profile data and an API key.
)
try:
with urllib.request.urlopen(req, timeout=60) as response:
result = json.loads(response.read().decode('utf-8'))
if result.get('base_resp', {}).get('status_code') == 0:
return result
The request destination is derived from environment-controlled input via MINIMAX_API_HOST and then used in urllib.request.urlopen. In many agent/runtime deployments, environment variables can be influenced by operators, wrappers, or compromised execution contexts, which can turn this into SSRF-style outbound access or silent exfiltration of prompts and API credentials to an attacker-controlled host.
)
try:
with urllib.request.urlopen(req, timeout=60) as response:
result = json.loads(response.read().decode('utf-8'))
if result.get('base_resp', {}).get('status_code') == 0:
return result
Accessing a general-purpose home .env file gives the skill visibility into credentials unrelated to its stated purpose, which is excessive for a fortune-telling script. Even if only MINIMAX_API_KEY is intended, the export pattern loads all secrets into the process environment where they may be consumed by child processes or accidentally exposed.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILL_DIR="$(dirname "$SCRIPT_DIR")"
if [ -f "$HOME/.clawd/.env" ]; then
export $(grep -v '^#' "$HOME/.clawd/.env" | xargs)
fi
The export command on the .env contents causes every parsed variable from the user's home configuration to become available to this script and any subprocesses it spawns. In a script that also performs network requests, this unnecessarily increases the risk of credential misuse or leakage if later code changes, dependencies, or prompt content become adversarial.
SKILL_DIR="$(dirname "$SCRIPT_DIR")"
if [ -f "$HOME/.clawd/.env" ]; then
export $(grep -v '^#' "$HOME/.clawd/.env" | xargs)
fi
# 默认 API 配置
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
Create a visually stunning image that tells the story of a soul's previous incarnation, blending traditional Chinese spiritual aesthetics with mystical portrait art.
"""
return prompt
def generate_future_partner_prompt(bazi_info, partner_traits):
"""
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
Create a visually stunning image that tells the story of a soul's previous incarnation, blending traditional Chinese spiritual aesthetics with mystical portrait art.
"""
return prompt
def generate_future_partner_prompt(bazi_info, partner_traits):
"""
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
Create a visually stunning image that tells the story of a soul's previous incarnation, blending traditional Chinese spiritual aesthetics with mystical portrait art.
"""
return prompt
def generate_future_partner_prompt(bazi_info, partner_traits):
"""
The skill advertises capabilities implying access to environment, file writes, network, and shell behavior, but it does not declare any explicit tool scope or permissions boundary. That creates an authorization ambiguity where a host may grant broader powers than users expect, increasing the risk of unintended data access, persistence, or external transmission.
The skill asks for sensitive personal data including name, gender, birthplace, and full birth date/time, which can be highly identifying, but it does not clearly warn users about privacy risks at the point of collection. In this context, birth data is central to the feature, so the danger is not the collection itself but collecting more than necessary without transparent notice, consent, or minimization.
The skill explicitly states that user chart data is stored in local JSON, but provides no retention, deletion, access-control, or user-warning details. Because the stored data may include full birth details and derived profile data, silent persistence materially increases privacy risk and could expose sensitive information to other local users, backups, logs, or later compromise.
The prompt explicitly requests highly sensitive personal data, including full name, former name, gender, alive/deceased status, birthplace, and precise birth date/time, without any privacy notice, minimization guidance, or handling restrictions. In this skill context, collecting exact identity and birth data for a fortune-telling service is not strictly necessary at full precision and increases privacy, profiling, and potential misuse risks if the data is logged, retained, or exposed.
The file defines the skill entirely in Chinese and directly instructs the model to act as a fortune analyst in that language context, with no indication that users may choose another language. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation.
The prompt template explicitly requires Chinese output, including a Chinese title, while the file provides no user opt-in or alternative language handling. This is a natural-language policy concern because it imposes a specific language/locale rather than allowing user preference.
The file instructs the model to output the tarot reading in Chinese-specific phrasing and format ('请按以下格式输出塔罗解读') throughout a fully Chinese prompt, but it does not provide any user opt-in or alternative language option. This creates a natural-language locale policy issue because the skill effectively enforces a specific language without documented justification.
The example prompts explicitly request highly sensitive personal data including full name, gender, birthplace, full birth date, and birth time, but provide no privacy notice, data minimization guidance, or explanation of how that data will be handled. In a fortune-telling context this information is not just identifying but often sufficient for profiling, making oversharing likely and increasing privacy and misuse risk.
The tarot example gives directional advice about whether to stay in a stressful job or consider changing employment, but does not warn users that generated content is entertainment or reflective guidance rather than professional life, financial, or mental health advice. Users under stress may over-rely on authoritative-seeming divination output for consequential decisions, which creates a real risk of harmful action based on unreliable guidance.
The script indiscriminately loads and exports every variable from $HOME/.clawd/.env, which expands the skill's access beyond what a fortune-telling feature needs. This can expose unrelated local secrets or configuration to later subprocesses and network calls, violating least-privilege and increasing the blast radius if the script or its dependencies are compromised.
This code performs an external HTTP request carrying user-supplied content and sensitive personal details to a remote model API. External transmission is expected for this kind of tool, but in the security context it remains a genuine data-exposure surface, especially because the host is configurable via environment variables and the payload includes personal information.
return 1
fi
curl -s --max-time 60 \
-H "Authorization: Bearer $MINIMAX_API_KEY" \
-H "Content-Type: application/json" \
-X POST "$MINIMAX_API_HOST/v1/text/chatcompletion_v2" \
The script sends personal data such as name, gender, birthplace, birth date, and questions to a third-party API, but the script provides no explicit consent prompt, warning, or data minimization. Because fortune-telling inputs are highly personal, this creates a real privacy risk and may transmit more identifying information than users expect.
The file-level description and user-facing behavior are written exclusively in Chinese, and the generated image is instructed to use a Chinese title. This imposes a specific language/locale without any opt-in or alternative, which matches the language-policy violation criteria.
The manifest describes an AI fortune-telling tool focused on Bazi, tarot, and luck analysis, but this file additionally depends on external image-generation infrastructure by reading MINIMAX_API_KEY/MINIMAX_API_HOST and POSTing generated prompts off-box. While visualization could be related, using external hosted image generation and credential-based network access is a separate capability not expressed in the stated purpose of divination and analysis.
The prompt hard-codes "Title in Chinese" and a Chinese subtitle requirement, ensuring generated content uses a fixed language regardless of user preference. Because no language selection mechanism or justification is present, this is a natural-language policy violation.
Lines L119-L120 explicitly state the fortune segmentation is simulated fake data and that real Bazi analysis would be added later. However, the program immediately displays these segments to the user as their fortune preview (L136-L140), uses them to generate the final image (L142-L146), and saves them as result data (L157-L166), creating a direct contradiction between the internal documentation and actual behavior.
The script sends user-derived birth-chart attributes and the user's name to an external image-generation service as part of the prompt, but there is no explicit consent flow, privacy notice, or data-minimization step. Even if the data is not highly regulated by itself, it is personal profiling data and may be sensitive in the context of astrology, relationship inference, and spiritual characterization.
The natural-language description, instructions, and examples are entirely in Chinese, which can amount to a language policy issue when no user opt-in or locale justification is provided. There is no statement that the skill is intended only for Chinese-speaking users or that alternative language support is unavailable by design.