T09 · Insecure Skill Coding Practices
- Location
SKILL.md:117- Finding
Plaintext Database Credentials Embedded in Skill Documentation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is an API testing/reporting tool, but it publishes real-looking database credentials and can run broad database-backed tests while saving sensitive request and response data without redaction.
Review before installing. Rotate the exposed database password if it was ever valid, replace examples with placeholders, run only against approved staging systems, use least-privilege read-only database accounts, restrict fixture SQL to reviewed SELECT queries, redact secrets and personal/business data from generated reports, and pin dependencies or bundle report assets locally.
SKILL.md:117Plaintext Database Credentials Embedded in Skill Documentation
scripts/run_api_test.py:97Arbitrary Configuration-Supplied SQL Execution Against the Fixture Database
scripts/generate_report.py:36Generated Reports Load Remote Executable JavaScript Without Integrity Verification
scripts/run_api_test.py:419Complete API Requests, Responses, and Fixture Values Are Persisted Without Redaction
SKILL.md:221Python Dependencies Are Installed Without Version or Hash Pinning
The skill explicitly instructs the agent to pull real values from a database, send them to HTTP endpoints, and include full request/response data in generated reports, but provides no user warning or consent gate for handling sensitive data. In this context, that can expose credentials, tax identifiers, invoice data, and live business records to external services and to persistent local artifacts such as HTML and JS report files.
This markdown skill lists trigger phrases such as "生成测试报告" and "逐个验证参数", which are broad enough to overlap with common requests outside this specific API-testing skill. The description does not provide negative examples or tighter activation constraints to distinguish when the skill should or should not activate.
The natural-language comments and labels are written entirely in Chinese, indicating the skill configuration is intended to be used in a single language without any opt-in or alternative locale. Under the policy, forcing a specific language without user choice or a documented regional justification is a natural-language policy concern.
The document describes automatically generating and executing API tests against a configurable base URL and collecting results, but it does not warn about targeting staging-only environments or the possible effects on live systems. Without such guardrails, users may unintentionally send bulk or malformed test traffic to production endpoints, causing data corruption, operational noise, or service disruption.
The workflow explicitly instructs the test runner to connect to MySQL, execute configured SQL queries, and pull real values into API tests, but it provides no warning to avoid production systems, minimize sensitive data access, or protect credentials. In a testing skill, this omission can lead users to run queries against live databases and expose customer or business data in logs, reports, or downstream requests.
The script supports connecting to a real MySQL instance using provided credentials and executing arbitrary configured SQL to pull production-like data into test requests. In this skill context, that increases the chance of exposing sensitive database contents into logs, reports, or downstream HTTP requests, especially because there are no environment restrictions, query safeguards, or masking controls.
This code sends API requests using user-supplied configuration and request bodies, which can include business or system data, but there is no user-facing disclosure at the point of transmission beyond generic test-run output. The surrounding docstring describes functionality, but it does not warn that request payloads and target URLs will be transmitted over the network to the configured endpoint.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if http_method.upper() == "GET":
resp = requests.get(url, params=body, headers=headers, timeout=timeout)
else:
resp = requests.post(url, json=body, headers=headers, timeout=timeout)
try:
return {"status_code": resp.status_code, "body": resp.json(),
"raw": resp.text, "error": None}
The tool persists full request bodies and response bodies to JSON and HTML reports, which can include credentials, personal data, tokens, invoices, or other sensitive business data returned from real APIs. In this testing context, the risk is elevated because the script also supports loading real database values and transmitting them to live services, so the saved artifacts can become a durable local data leak.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
report_script = os.path.join(os.path.dirname(os.path.abspath(__file__)), "generate_report.py")
if os.path.exists(report_script):
import subprocess
subprocess.run(
[sys.executable, report_script,
"--results", json_path,
"--output", html_path,
The HTML declares lang="zh-CN", which fixes the report to a specific language/locale. The policy for this audit flags locale constraints when the skill does not offer user opt-in or explain why the report must be Chinese.
Visible strings such as the title, loading text, labels, and error messages are all written in Chinese, indicating the skill forces one language for generated output. There is no evidence in this file of a user-selectable language option or documented regional scope.
The file's user-facing docstring and command guidance are entirely in Chinese, with no indication that another language is available or that the locale is intentionally constrained. Under the stated policy, user-facing language constraints should be optional or clearly justified.