T09 · Insecure Skill Coding Practices
- Location
mx_zixuan.py:231- Finding
Ambiguous Input Defaults to an Account-Mutating API Operation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly matches its watchlist-management purpose, but it can send ambiguous authenticated commands to an account-mutating endpoint without strong local safeguards.
Install only if you are comfortable giving the skill an Eastmoney API key that can query and change your personal watchlist. Use explicit query/add/delete commands with a clear stock code or name, avoid vague natural-language requests, and be aware it may read MX_APIKEY from a parent .env file and may over-report mutation success on inconsistent API responses.
mx_zixuan.py:231Ambiguous Input Defaults to an Account-Mutating API Operation
mx_zixuan.py:177Conflicting API Status Fields Can Be Reported as a Successful Mutation
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
try:
response = requests.post(QUERY_URL, headers=headers, json={}, timeout=30)
response.raise_for_status()
return response.json()
except Exception as e:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
try:
response = requests.post(MANAGE_URL, headers=headers, json=data, timeout=30)
response.raise_for_status()
return response.json()
except Exception as e:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
apikey = os.environ.get("MX_APIKEY", "")
if not apikey:
# 尝试从.env文件读取
env_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env")
if os.path.exists(env_file):
try:
with open(env_file, "r") as f:
The skill instructs execution of a local Python script that requires environment access (MX_APIKEY), performs networked API calls, and writes output files, but the manifest declares no explicit tool scope or permission boundaries. This creates an over-privileged integration risk: the runtime may grant broader capabilities than are obvious from the skill contract, making review, enforcement, and least-privilege controls harder.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
try:
response = requests.post(QUERY_URL, headers=headers, json={}, timeout=30)
response.raise_for_status()
return response.json()
except Exception as e:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
try:
response = requests.post(MANAGE_URL, headers=headers, json=data, timeout=30)
response.raise_for_status()
return response.json()
except Exception as e:
Add/delete operations are executed immediately without any confirmation step, dry-run preview, or explicit warning. In a skill that modifies a user’s personal watchlist, ambiguous input or accidental invocation can cause unintended state changes, especially because the code also accepts natural-language management requests.
The fallback path forwards arbitrary natural-language input to the management endpoint whenever the text is not classified as a query. That expands behavior beyond the manifest’s explicit query/add/delete scope and can trigger unintended watchlist modifications from ambiguous phrasing or prompt-manipulated input.
Natural-language strings throughout the file, including the module description and CLI help text, are exclusively in Chinese. This effectively forces a specific language for user interaction without any visible opt-in, alternative language support, or documented region-specific justification.
For a skill whose stated purpose is simply managing a personal watchlist, reading secrets from a parent-directory .env file is an extra capability not described in the manifest. This expands the skill’s local file access to credential discovery behavior that is not obviously required by the declared user-facing function.