Back to skill

Security audit

实时财经

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches a Sina Finance news fetcher, but it also ships an under-disclosed browser automation script that can access an existing local browser session.

Install only if you are comfortable with local news retention and a Chinese-language Sina Finance workflow. Use the documented fetch_api.js path for collection, avoid running fetch_and_save.js unless it is changed to use an isolated browser and fail closed, and enable any cron schedule only after deciding you want recurring local writes.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
fetch_and_save.js:73
Finding

Overprivileged Access to an Existing Local Browser Session

Content
View full analysis

Vulnerability Details

File Location: fetch_and_save.js, lines 73–79
Vulnerability Type: Excessive browser-session privileges and unsafe fallback to an arbitrary tab
Risk Level: Medium

Vulnerable Code

js
const browser = await puppeteer.connect({ browserURL: 'http://localhost:9222' });
const pages = await browser.pages();
const page = pages.find(p => p.url().includes('finance.sina.com.cn/7x24')) || pages[0];

await new Promise(r => setTimeout(r, 2000));

const news = await page.evaluate(() => {

Technical Analysis

The script attaches Puppeteer to an already running, debugging-enabled browser rather than creating an isolated browser context. This gives the script access to every page exposed through that browser's Chrome DevTools Protocol session, including pages containing authenticated or sensitive user content.

The requested financial-news page is selected using a substring comparison. More importantly, if no matching page exists, the expression falls back to pages[0]. The script then executes page.evaluate() in that unrelated page and queries broad selectors such as .time, .txt, and partial class-name matches. This violates least privilege because public financial-news retrieval does not require access to the user's existing browser session. The documented primary workflow already retrieves the news through fetch_api.js without browser access.

No evidence was found that the captured content is transmitted to an external party. However, matching text from the selected page can be stored locally in data/news_db.json.

Attack Path

  1. A user starts Chrome or Chromium with remote debugging enabled on port 9222.
  2. The browser contains authenticated or otherwise sensitive open tabs.
  3. The user invokes fetch_and_save.js.
  4. The script connects to the existing DevTools session and enumerates all open pages.
  5. If no URL contains finance.sina.com.cn/7x24, the script silently selects the first page.
  6. `page.e ...[truncated 862 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove fetch_and_save.js if it is obsolete, and retain only the documented HTTPS API workflow in fetch_api.js.
  2. If browser automation remains necessary, launch a dedicated browser instance or isolated browser context rather than connecting to the user's existing browser profile.
  3. Navigate the isolated page directly to an exact allowlisted HTTPS URL.
  4. Remove the || pages[0] fallback and fail closed if the expected page is unavailable.
  5. Validate the page origin before calling page.evaluate(). Require the exact expected hostname and protocol rather than a URL substring.
  6. Narrow the DOM selectors to selectors unique to the expected news page.
  7. Avoid exposing Chrome DevTools on a reusable user profile. Bind it only to loopback, use a temporary profile, and terminate the isolated browser after collection.
  8. Add tests confirming that the script refuses to operate on unrelated tabs and cannot read from an existing authenticated session.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

声明的核心目标与代码部分重合:确实是在抓取新浪财经7x24新闻并做一定汇总/增量保存。但存在多处重要不一致。第一,描述称“通过API接口”,而实际代码使用 Puppeteer 连接本地浏览器并从网页 DOM 提取内容,这是实现方式上的实质差异。第二,描述称“每5分钟自动抓取最新新闻”,但该代码只是一次性执行的脚本,没有任何 cron、setInterval 或调度逻辑。第三,代码会将数据持久化到本地 JSON 数据库和状态文件,这属于未在声明中体现的资源访问/存储能力。第四,所谓“智能增量检测”在代码中仅体现为按当天 time 字段去重,能力明显弱于描述。综合看,描述未准确代表代码实际行为,属于不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

声明强调的是“实时抓取、API增量检测、每5分钟自动抓取新浪财经新闻”,而该代码片段实际只是一个本地存储层模块。它使用 fs/path 在本地 data/news_db.json 中读写新闻数据,按当天日期分组、按 time 字段去重、保留 7 天历史,并提供 save/get-today/get-all/stats 的 CLI 命令。代码中没有网络请求、没有新浪财经相关逻辑、没有定时调度、没有自动抓取流程。因此其主要行为与声明的核心功能存在明显不一致。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 33)May include surrounding context.

md
- 新闻保存到 `data/news_db.json`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The markdown instructs users to configure periodic execution and states that the skill continuously writes and retains local data, but it does not present this as a clear operational warning or ask for explicit user consent. Ongoing scheduled collection and background file writes can surprise users, create unintended data retention, and increase risk if run in sensitive environments or shared workspaces.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON data file contains natural-language content entirely in Chinese, indicating a fixed language/locale choice with no accompanying option for user language preference. Under the policy, forced language/locale behavior without opt-in is a reportable natural-language violation even in config/data files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The dataset materially exceeds the declared scope of a 'real-time financial news' skill and contains political, military, social, and other non-financial content. If downstream prompts, summaries, alerts, or trading logic assume the corpus is finance-only, this scope drift can pollute outputs, trigger prompt/context injection from untrusted article text, and cause unsafe or misleading decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language content, including comments and user-facing console messages, is entirely in Chinese. This imposes a specific language on users without any opt-in, fallback, or documented justification for a locale-specific audience, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file name, description, headings, and usage instructions are all presented only in Chinese, with no indication that users may choose another language or that the locale is intentionally limited for a region-specific compliance reason. This creates a natural-language policy concern because it imposes a language constraint by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JavaScript file contains natural-language comments and console output entirely in Chinese, including the main status and error messages shown during execution. Under the policy provided, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.