T09 · Insecure Skill Coding Practices
- Location
scripts/news_headlines.py:25- Finding
API Key Transmitted Through Plaintext HTTP Query Strings
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This news skill appears purpose-built, but it sends the user's API key over unencrypted HTTP and also documents weaker ways to handle that key.
Install only if you are comfortable using a Juhe API key with this skill. Before real use, prefer JUHE_NEWS_KEY over --key, avoid committing scripts/.env, and update the endpoints to HTTPS if Juhe supports it; otherwise your API key and returned news data can be exposed or modified on the network.
scripts/news_headlines.py:25API Key Transmitted Through Plaintext HTTP Query Strings
scripts/news_headlines.py:194API Key Accepted Through a Process Command-Line Argument
The skill instructs users to store the API key in a plaintext .env file under the scripts directory, which is a common location that may be read by tooling, packaged accidentally, or committed to source control. This increases the chance of credential leakage and unauthorized use of the API key.
# 方式一:环境变量(推荐,一次配置永久生效)
export JUHE_NEWS_KEY=你的AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_NEWS_KEY=你的AppKey" > scripts/.env
# 方式三:每次命令行传入
The documentation recommends passing the API key directly on the command line, which can expose the secret through shell history, process listings, logging, and telemetry. Command-line arguments are routinely visible to other local users or monitoring tools, making this a higher-risk credential-handling practice.
export JUHE_NEWS_KEY=你的AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_NEWS_KEY=你的AppKey" > scripts/.env
# 方式三:每次命令行传入
python scripts/news_headlines.py --key 你的AppKey --type top
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 环境变量: export JUHE_NEWS_KEY=your_api_key
2. 脚本同目录的 .env 文件: JUHE_NEWS_KEY=your_api_key
3. 直接传参: python news_headlines.py --key your_api_key --type top
免费申请 API Key: https://www.juhe.cn/docs/api/id/235
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 环境变量: export JUHE_NEWS_KEY=your_api_key
2. 脚本同目录的 .env 文件: JUHE_NEWS_KEY=your_api_key
3. 直接传参: python news_headlines.py --key your_api_key --type top
免费申请 API Key: https://www.juhe.cn/docs/api/id/235
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if env_key:
return env_key
env_file = Path(__file__).parent / ".env"
if env_file.exists():
for line in env_file.read_text(encoding="utf-8").splitlines():
line = line.strip()
The skill advertises executable behavior that uses environment variables, local file access, and outbound network access, but it does not declare an explicit tool scope or permission boundary. This can cause the host agent to invoke the skill with broader capabilities than users expect, reducing transparency and making accidental misuse of secrets or network access more likely.
The activation examples are broad enough that common phrases like '新闻列表' or general requests for headlines may trigger the skill in situations where the user did not clearly consent to a third-party lookup. Over-broad triggering increases the chance of unintended external requests and unnecessary sharing of user queries with the API provider.
Although the document mentions Juhe as the data provider, it does not clearly warn users that their query text will be transmitted to an external third-party service. This weakens informed consent and may expose user interests or sensitive phrasing to the provider without an explicit privacy notice.
The script explicitly supports passing the API key on the command line, which can expose the secret through shell history, process listings, job-control logs, and operational tooling. While this is not code execution, it is a real credential-handling weakness because the script documents and encourages an unsafe secret-delivery method without warning users.
Natural-language policy violations apply to all file types, including code docstrings and printed strings. This script forces a specific language for usage instructions and runtime messages, with no indication that users can choose another locale or that the tool is region-specific by design.
No suspicious patterns detected.