T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/xhs_daily_fetcher.py:27- Finding
Shell startup files are scanned to discover and transmit API credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent trend-reporting purpose, but its API-key handling and generated HTML introduce enough security risk that users should review it before installing.
Install only if you are comfortable sending a RedFox API key and query metadata to redfox.hk. Prefer a session-scoped environment variable or secret manager instead of letting an agent write or echo the key in shell profiles. Treat generated HTML and JSON cache inputs as untrusted, and be aware that reports load JavaScript from a CDN when opened. Enable daily subscription only with clear intent and a known cancellation path.
scripts/xhs_daily_fetcher.py:27Shell startup files are scanned to discover and transmit API credentials
references/core_workflow.md:35Instructions persist and display the API key in plaintext
scripts/gen_xhs_html.py:527Untrusted API and cache values are inserted into generated HTML without contextual escaping
scripts/gen_xhs_html.py:307Generated and bundled reports execute remote JavaScript without integrity verification
SKILL.md:43Installation guidance uses an unpinned Python dependency
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}")
The workflow explicitly instructs the agent to persistently modify the user's shell/profile or Windows user environment to store an API key, and even says the agent should proactively help perform that setup. This crosses from content retrieval into privileged system modification involving sensitive credentials, increasing the risk of credential exposure, unintended persistence, and changes that affect future sessions and unrelated tools.
The document directs the agent to help persistently configure an API key but omits strong warnings about secret handling, profile-file modification, cross-shell persistence, and the security implications of storing credentials in plain environment configuration. That makes accidental disclosure, overbroad persistence, and unsafe handling of secrets much more likely.
The README instructs users to invoke the skill with broad natural-language requests and says no commands need to be memorized, but it does not define clear activation boundaries. In an agent environment, this can cause accidental triggering from ordinary conversation, making the skill run on ambiguous user text and increasing the chance of unintended external data access or actions such as subscriptions.
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
### Quick Reference
| Intent | Example phrase | Result |
| ------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Query today's virals | `Show me viral notes about mascara` | Auto-matches category, outputs today's breakout TOP20 + three-dimension analysis + HTML + subscription option |
| Query general hot content | `What's trending on Xiaohongshu lately?` | Uses "All" category, full four-section output |
The example query 'What's trending on Xiaohongshu lately?' is a very generic conversational request that can easily overlap with normal chat. In a multi-skill or agent setting, such a loose trigger can cause unintended skill selection, resulting in unplanned API usage, data retrieval, or downstream actions based on user text that was not meant as a tool invocation.
The README states "直接用自然语言描述需求,无需记忆命令", which implies the skill may activate from unrestricted everyday phrasing rather than a narrowly defined command set. This ambiguity is reinforced by examples like "帮我查一下..." and "最近小红书有什么热门内容", which overlap with ordinary conversational requests and do not define clear boundaries or exclusions.
The skill documents capabilities that read environment variables, read/write local files, and make network requests, but it does not declare any explicit tool scope or permission boundaries. In agent platforms, missing scope metadata can cause overbroad tool exposure or make review and runtime enforcement impossible, increasing the chance of unintended secret access, file writes, or external data exfiltration.
The trigger examples around free-form phrases like querying hot content or keyword-based requests are broad enough that an agent may activate the skill during ordinary conversation without clear user intent. This can lead to unintended network calls, use of API-backed features, file generation, or subscription actions when the user was only asking generally about trends or examples.
The usage guidance includes ambiguous commands such as broad category requests, '查看更多', and numeric shortcuts like '1' or '2', which are unsafe without strict conversational state checks. In a multi-turn agent setting, these generic replies can be misinterpreted outside the intended workflow and trigger subscriptions or HTML generation unexpectedly.
文档标题及整体输出规范均默认并强制中文内容与中文固定文案,未见提供用户语言偏好选择或英文等替代输出方式。对于通用技能文档,这会构成语言/locale 强制要求而缺少用户 opt-in。
The skill advertises a subscription/push capability beyond an on-demand query tool, enabling recurring autonomous actions and outbound delivery. In an agent context, this broadens the operational scope and can cause unsolicited future actions, especially when combined with vague triggers and mandatory output behavior.
The trigger condition is very broad, covering generic discussion of popular content and trend analysis, which raises the chance of accidental activation during ordinary conversation. In this skill, that matters because activation can lead to external API use, credential checks, and prescribed follow-on actions without a narrowly scoped user request.
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
**💡热门内容分析**
| 内容分类 | 内容特征 | 实际效果 | 参考笔记 |
| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :--------------------------------- |
| 封面设计 | 采用高清摄影或设计软件精心制作的封面图,画面构图饱满、色彩搭配协调,同时加入醒目的文字标题或标签,突出核心卖点或吸引眼球的元素,通过强烈的视觉冲击力在用户快速浏览时瞬间抓住注意力 | 点击率提升45% | [笔记标题链接1]<br>[笔记标题链接2] |
| 内容创作 | 围绕用户痛点或情感共鸣点展开叙事,采用第一人称视角分享真实经历或心得,结合表情符号和分段排版增强可读性,适当设置悬念或反转,激发用户的情感共鸣和参与欲望 | 互动率提升50% | [笔记标题链接3]<br>[笔记标题链接4] |
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
**📈爆款标题分析**
| 标题类型 | 标题特征 | 标题模版 | 发布规律 | 参考标题 |
| :------- | :----------------------------------------------------------------------------------------------------------------- | :--------------- | :------------------- | :----------------------- |
| 提问式 | 标题以疑问句开头,设置悬念或提出用户关心的问题,引发用户的好奇心和思考欲望,激发点击阅读或评论互动 | "你还在XX吗?" | 工作日早高峰效果最佳 | 这个方法你还在用吗? |
| 数字式 | 标题中包含具体的数字、数量或统计数据,利用人们对量化信息的偏好,增强内容的可信度和专业感,让用户觉得内容有价值 | "XX个XX技巧" | 午餐时间点击率高 | 5个快速提升XX的技巧 |
The workflow states that after keyword matching, the agent should not tell the user which category was matched. However, the mandatory title format later requires outputting '【{分类名称}】每日爆款笔记', which necessarily reveals the matched category, so the documentation contradicts itself about intended behavior.
The script scans local shell startup files such as .zshrc and .bashrc to extract REDFOX_API_KEY, which expands its access to sensitive local configuration beyond what is necessary for trend-query functionality. Even though it targets one variable name, reading shell profiles creates unnecessary exposure to secrets and local environment details and can surprise users who did not consent to that access.
Reading shell profile files for credentials without an explicit, user-facing warning is a sensitive local-data access behavior that exceeds normal expectations for an HTML report generator. This can expose secrets stored in startup files and undermines least-privilege handling of local credentials.
This request transmits the user's API key in the X-API-KEY header and sends query parameters including category and date to an external service. While the file docstring says data is fetched from an API, the code does not provide a direct runtime disclosure that credentials and request metadata are being sent off-host.
The script scans local shell profile files such as ~/.zshrc and ~/.bashrc to extract REDFOX_API_KEY without explicit user consent at runtime. This expands the skill's access beyond its stated purpose of fetching trend data and creates unnecessary local secret-discovery behavior; if the skill or surrounding environment were compromised, this pattern would normalize reading sensitive local configuration files.
Reading API credentials directly from shell startup files is a privacy and secret-handling issue because those files may contain unrelated credentials and personal configuration. The behavior is especially risky in an agent skill, where users may not expect the tool to inspect local profile files simply to obtain a network API token.
The script can write raw fetched data to an arbitrary local path via --output_json, which is broader than the skill description and can overwrite files the current user has permission to modify. In a skill context, arbitrary file write capabilities are sensitive because they can be repurposed for persistence, data staging, or tampering with local files if an untrusted caller controls the argument.
All user-facing instructions, examples, command phrases, and workflow guidance are presented exclusively in Chinese, and the skill does not state that language selection is optional or limited for a documented regional-compliance reason. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.
The generated HTML loads html2canvas and jsPDF from third-party CDNs at render time, introducing remote code execution in the browser context via externally hosted scripts. If the CDN resource is compromised, replaced, or blocked, users opening the generated report may execute attacker-controlled JavaScript or experience broken functionality.
Detected: suspicious.exposed_secret_literal