T09 · Insecure Skill Coding Practices
- Location
scripts/daily_fetch.py:157- Finding
Arbitrary File Overwrite Through an Unrestricted Output Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its news-brief purpose, but it can automatically run an unverified neighboring script and can write output to unrestricted file paths, so it needs review before installation.
Install only if you are comfortable with a Chinese-language tech-news collector that makes public web requests. Before routine use, constrain the output path to a dedicated directory, remove or explicitly verify the neighboring ai-policy-brief execution path, and pin dependencies with a reviewed lock file.
scripts/daily_fetch.py:157Arbitrary File Overwrite Through an Unrestricted Output Path
scripts/daily_fetch.py:45Automatic Execution of an Unverified Script From a Sibling Project
scripts/daily_fetch.py:91Untrusted Remote Data Is Written as Unsanitized Active Markdown
requirements.txt:3Third-Party Dependencies Are Installed Without Exact Versions or Integrity Hashes
The trigger phrases are broad, generic, and overlap with ordinary requests for technology news, which can cause the skill to activate when the user did not specifically intend to use it. This creates a scope/intent mismatch that may route general queries into this skill unexpectedly, leading to inappropriate execution, unnecessary network access, or confusing results.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if policy_script.exists():
import subprocess
try:
result = subprocess.run(
[sys.executable, str(policy_script), '--days', str(days)],
capture_output=True,
text=True,
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
try:
# B站热门榜
resp = SESSION.get(
'https://api.bilibili.com/x/web-interface/popular?ps=20&pn=1',
timeout=10
)
data = resp.json()
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
try:
# B站热门榜
resp = SESSION.get(
'https://api.bilibili.com/x/web-interface/popular?ps=20&pn=1',
timeout=10
)
data = resp.json()
All user-facing instructions, trigger phrases, and output examples are presented only in Chinese, which implies a fixed language/locale behavior. The file does not state that the skill is region-specific or provide users with an option to choose another language.
This markdown file presents all headings, labels, and usage-oriented content exclusively in Chinese, which can amount to a language/locale policy violation when no user opt-in or justification is provided. The file does not indicate that the skill is region-specific or that users may choose another language.
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens build reproducibility and can unintentionally introduce vulnerable or incompatible releases into the environment.
# Tech Brief 依赖
requests>=2.28.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
python-dateutil>=2.8.0
The manifest does not pin requests, and the package has multiple known advisories across versions. Without an exact version, it is impossible to verify whether deployments are using a fixed release, creating uncertainty around exposure to known issues such as credential leakage or TLS-related defects.
Using an unpinned version range for this package means installations are not deterministic and may pull in newer releases without review. That increases supply-chain risk and makes it harder to ensure that only vetted versions are deployed.
# Tech Brief 依赖
requests>=2.28.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
python-dateutil>=2.8.0
feedparser>=6.0.0
An unpinned lxml dependency is risky because different environments may install different releases, including ones with known security issues. Since lxml has historically had security advisories, lack of pinning makes exposure harder to assess and control.
requests>=2.28.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
python-dateutil>=2.8.0
feedparser>=6.0.0
lxml has a history of security advisories, and because the dependency is unpinned, the actual installed version cannot be verified from this manifest alone. This leaves the project unable to demonstrate that it is consistently using a non-vulnerable release.
The package is not pinned to a specific version, so builds are not reproducible and may consume unreviewed future releases. While not directly exploitable by itself, this is a dependency hygiene weakness that can enable supply-chain or stability issues.
requests>=2.28.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
python-dateutil>=2.8.0
feedparser>=6.0.0
Leaving feedparser unpinned permits installation of any later version satisfying the lower bound, making the deployed package set unpredictable. Given the package's advisory history, this increases the chance of unintentionally deploying an affected version.
beautifulsoup4>=4.12.0
lxml>=4.9.0
python-dateutil>=2.8.0
feedparser>=6.0.0
feedparser has known historical advisories, and the lack of version pinning prevents confirmation that only safe releases are installed. This is especially relevant for software that parses external feeds, where parser flaws could be exposed by attacker-controlled content.
The module docstring and all user-facing descriptions are written in Chinese, which imposes a specific language on users without any visible opt-in or explanation. Under the policy rule, a forced language/locale choice is a natural-language policy concern unless the tool clearly documents that it is intended for a Chinese-only audience.
This code file contains natural-language strings such as the module docstring, dependency error message, and CLI help text in Chinese only. The policy requires avoiding forced language or locale choices unless the skill offers user opt-in or clearly documents the locale restriction.
The module docstring states the script collects hot topics from 微博、知乎、B站, which matches the implemented behavior. However, the nearby '数据源' declaration only lists Weibo and Zhihu, while separate code later performs live requests to Bilibili. This creates an internal documentation/configuration contradiction about what sources the script is intended to use.
The Accept-Language header is fixed to 'zh-CN,zh;q=0.9,en;q=0.8', which imposes a specific locale preference in the skill's behavior. Under the policy, locale constraints should either be user-selectable or clearly justified as region-specific.