T09 · Insecure Skill Coding Practices
- Location
scripts/qianfan_search.py:34- Finding
Qianfan API Key Disclosure Through a Caller-Controlled Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a Baidu Qianfan search wrapper, but its script can send the user's API key to an arbitrary URL if invoked with the --url option.
Review before installing. Use only with a Qianfan API key you are comfortable exposing to this wrapper, avoid passing keys on the command line, and do not let prompts or untrusted automation supply --url. The publisher should remove --url or strictly allowlist the exact Qianfan HTTPS endpoint before this is treated as a routine install.
scripts/qianfan_search.py:34Qianfan API Key Disclosure Through a Caller-Controlled Endpoint
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
)
try:
with request.urlopen(req, timeout=30) as resp:
body = resp.read().decode("utf-8", errors="replace")
except error.HTTPError as e:
detail = e.read().decode("utf-8", errors="replace")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
set -a
source ./.env.local
set +a
Referenced artifact was not completely inspected
- Never place the real API key in `SKILL.md` or `references/`.
Without declared permissions the skill's intent is opaque and cannot be validated.
The quick-start and common-pattern examples consistently prescribe Chinese query text such as "北京有哪些旅游景区" and "百度千帆平台", which can signal a language expectation to users. The file does not explicitly say the skill supports multiple languages or that Chinese is required due to a documented regional/compliance constraint, so this may violate the language/locale policy.
Although the skill is described as a dedicated Baidu/Qianfan search wrapper, it accepts a user-supplied --url and will POST the full payload plus the X-Appbuilder-Authorization bearer token to any destination. That expands the tool into a generic authenticated HTTP client and can leak the AppBuilder credential to attacker-controlled infrastructure.
User-controlled endpoint selection gives this narrowly scoped search skill broader outbound network capability than its declared purpose justifies. In agent environments, this can be abused to make arbitrary POST requests containing attacker-influenced content and potentially sensitive data, increasing SSRF-style and exfiltration risk even if the script is not a fully general HTTP client.
This code performs an HTTP POST to the Baidu Qianfan search API containing the user's query and optional site filters. While the script name and argument parser imply web search behavior, there is no explicit user-facing warning, confirmation, or comment in the file that the provided query will be transmitted to a third-party service.
No suspicious patterns detected.