T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_explosive_articles.py:235- Finding
API credentials transmitted over connections with TLS certificate validation disabled
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s Xiaohongshu reporting purpose is coherent, but it needs Review because it handles API credentials and generated reports in ways that can expose users to avoidable security risk.
Install only if you are comfortable giving the skill a RedFox API key and generating local reports from RedFox/Xiaohongshu data. Prefer a revocable, low-privilege key; set it only for the current session rather than letting an agent edit shell profiles; avoid opening generated reports with sensitive browser sessions; and review or patch the TLS verification and HTML escaping issues before routine use.
scripts/fetch_explosive_articles.py:235API credentials transmitted over connections with TLS certificate validation disabled
scripts/gen_xhs_html.py:645API-controlled values are inserted into generated HTML without contextual escaping
scripts/fetch_explosive_articles.py:97Scripts scan user shell profiles to recover an API credential
assets/preview-template.html:8Generated reports execute JavaScript retrieved from third-party CDNs
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
body = json.dumps(payload, ensure_ascii=False).encode("utf-8")
req = urllib.request.Request(url, data=body, headers=headers, method="POST")
with urllib.request.urlopen(req, timeout=30) as resp:
status_code = resp.status
raw = resp.read().decode("utf-8")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
# 接口仅支持 GET(query 参数);POST 会返回系统错误
response = requests.get(REDFOX_API_BASE, params=params, headers=headers, timeout=30)
if response.status_code >= 400:
return {"fetch_time": rank_date + " 19:00", "query_type": "日榜", "category": category, "hot_list": []}
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
# 接口仅支持 GET(query 参数);POST 会返回系统错误
response = requests.get(REDFOX_API_BASE, params=params, headers=headers, timeout=30)
if response.status_code >= 400:
raise Exception(f"HTTP请求失败: {response.status_code}, {response.text}")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
ssl_ctx.verify_mode = ssl.CERT_NONE
try:
with urllib.request.urlopen(req, context=ssl_ctx, timeout=30) as resp:
result = json.loads(resp.read().decode("utf-8"))
except urllib.error.HTTPError as e:
raise Exception(f"HTTP请求失败: {e.code}, {e.read().decode('utf-8', errors='replace')}")
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
The discrepancy between declared purpose and actual behavior is a true vulnerability because operators may grant the skill broad activation based on its description, unaware that it writes files, scans local config, and uses third-party APIs. In agent ecosystems, metadata honesty is part of the security boundary.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
---
name: xiaohongshu-inspiration
description: 小红书内容灵感聚合技能,覆盖选题灵感全链路:关键词爆款笔记搜索(相关性/热度/时效三维评分)、批量获取作品数据(支持 Excel/HTML 导出)、每日爆款 TOP50 爆发榜、低粉爆款挖掘(粉丝<5000 点赞>500)、账号日/周/月榜 TOP50、同阶对标与高阶标杆推荐。当用户需要小红书灵感、爆款搜索、笔记查询、批量获取作品、每日爆款、低粉爆款、账号榜单、涨粉榜、对标账号推荐时使用。触发词:小红书灵感、小红书爆款、小红书搜索、小红书�
Referenced artifact was not completely inspected
python3 scripts/fetch_xhs_hot_articles.py --keyword "睫毛膏" --max-items 10
Referenced artifact was not completely inspected
python3 scripts/fetch_xhs_hot_articles.py --keyword "睫毛膏" --max-items 10
Referenced artifact was not completely inspected
python3 scripts/fetch_explosive_articles.py --keyword "居家装修" --top_n 50
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{KEYWORD}} · 小红书低粉爆款笔记TOP{{TOP_N}}</title>
<!-- 使用多个CDN源,确保html2pdf.js能够加载 -->
<script src="https://cdn.jsdelivr.net/npm/html2pdf.js@0.10.1/dist/html2pdf.bundle.min.js"></script>
<script>
// 如果第一个CDN加载失败,尝试第二个
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{KEYWORD}} · 小红书低粉爆款笔记TOP{{TOP_N}}</title>
<!-- 使用多个CDN源,确保html2pdf.js能够加载 -->
<script src="https://cdn.jsdelivr.net/npm/html2pdf.js@0.10.1/dist/html2pdf.bundle.min.js"></script>
<script>
// 如果第一个CDN加载失败,尝试第二个
The workflow explicitly instructs the agent to persistently modify the user's shell profile or Windows user environment to store API credentials. This is dangerous because it causes the agent to change long-lived local configuration and handle secrets directly, increasing the risk of credential exposure, accidental propagation to other tools/sessions, and unauthorized system modification beyond the immediate task.
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
</head>
<body>
<div class="container">
<!-- 开场白 -->
<div class="intro">
<div class="intro-text">{{intro_text}}</div>
<div class="data-note">{{data_note}}</div>
TLS hostname checking is disabled and certificate verification is turned off before sending the API key in an HTTPS request. This allows man-in-the-middle interception or spoofing of the remote service, exposing credentials and tampering with returned content.
The skill metadata explicitly states '严禁任何联网搜索', yet the code performs external requests to redfox.hk and the generated HTML loads third-party CDN JavaScript at runtime. This violates the declared trust boundary and means using the skill can trigger undisclosed network egress and remote code loading.
The skill metadata explicitly says '严禁任何联网搜索', but this fallback path imports functions that re-fetch ranking data from a remote API when cache input is absent. That creates a policy-bypass behavior: an agent invoking this script can trigger outbound network access despite the declared no-network constraint, which is especially risky in a skill that advertises scraping/search capabilities.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
for rule in CATEGORY_INFER_RULES:
for kw in rule["keywords"]:
if kw.lower() in combined:
return rule["category"]
# 3. 兜底关键词
for category, keywords in FALLBACK_KEYWORDS.items():
Detected: suspicious.exposed_secret_literal, suspicious.insecure_tls_verification