Back to skill

Security audit

Macro News Signal

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed market-news analysis helper, but it gives the agent broad network-fetching and local-script execution paths that are not tightly scoped.

Review before installing. Use it only in an environment where outbound requests to third-party finance/news sites are acceptable, and avoid passing user-supplied or untrusted URLs to scripts/format.py unless the host enforces a strict allowlist. Treat generated buy/hold/sell outputs as informational analysis, not personalized financial advice.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/format.py:6
Finding

Unrestricted URL Fetching Enables Blind Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: scripts/format.py, lines 6 and 15–16, with attacker-controlled input entering at lines 68–70
Vulnerability Type: Blind server-side request forgery through an unrestricted URL fetch
Risk Level: Medium

Vulnerable Code

python
def fetch_and_format_stock_data(api_url):
    """
    仅使用 Python 标准库调用接口并构建 AI 友好结构
    """
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
    }
    
    try:
        req = urllib.request.Request(api_url, headers=headers)
        with urllib.request.urlopen(req) as response:
            if response.getcode() != 200:
                return {"error": f"HTTP Error: {response.getcode()}"}

The URL originates directly from a command-line argument:

python
api_url = sys.argv[1]

result = fetch_and_format_stock_data(api_url)

Technical Analysis

The script passes an arbitrary command-line URL directly to urllib.request.Request and urllib.request.urlopen. It does not:

  • Restrict the URL scheme to HTTPS.
  • Restrict the destination to the documented Yahoo Finance host.
  • Reject embedded credentials or nonstandard ports.
  • Resolve and block loopback, private, link-local, reserved, or cloud metadata addresses.
  • Validate redirect destinations.
  • Apply a network timeout.

Although the documented purpose is to retrieve Yahoo Finance chart data, the implementation can send a GET request to any destination reachable from the runtime environment. This creates a blind SSRF primitive.

Direct response disclosure is constrained because the response is subsequently parsed as Yahoo Finance JSON. Nevertheless, differences in returned errors, status behavior, and timing may reveal whether an internal endpoint exists or is reachable. GET requests can also affect internal services whose endpoints perform actions without proper authorization.

Attack Path

  1. An attacker influences the URL passed to the formatter, such as through ...[truncated 1338 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace arbitrary URL input with a validated market symbol and construct the Yahoo Finance URL internally.
  2. If URL input must remain supported, parse it with urllib.parse.urlsplit and permit only:
    • The https scheme.
    • The exact approved hostname, such as query1.finance.yahoo.com.
    • The default HTTPS port.
  3. Reject URLs containing user-information components, malformed hostnames, fragments, or unexpected ports.
  4. Resolve the hostname before connecting and reject all loopback, private, link-local, multicast, reserved, and unspecified IPv4 and IPv6 addresses using the ipaddress module.
  5. Disable automatic redirects or validate every redirect target with the same scheme, hostname, port, and IP-address controls.
  6. Add a short explicit timeout:
    python
    with urllib.request.urlopen(req, timeout=10) as response:
    
  7. Validate that the path matches the expected Yahoo Finance chart endpoint and that query parameters use an allowlist of supported values.
  8. Return generic network errors to reduce endpoint enumeration through detailed failure messages and timing differences.
  9. Run the skill in an environment with outbound network controls that deny access to loopback, private networks, and cloud metadata addresses unless explicitly required.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose promises macro-news ingestion and investment signal generation, but the described concrete implementation centers on fetching sources and formatting Yahoo Finance output via a local script. This mismatch is dangerous because it obscures the real operational behavior, making security review, user consent, and runtime policy enforcement less reliable.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Hard-coding accept-language: zh-CN,zh;q=0.9 can cause requests to reveal a locale preference the user did not choose, creating unnecessary fingerprinting and potentially altering returned content in ways that affect analysis accuracy. In a market-analysis skill that automatically collects third-party news, this can both leak contextual metadata and bias the collected information toward region-specific variants.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README instructs the skill to automatically fetch web pages and call third-party news APIs, including use of a browser-capable skill for dynamic access, without any user-consent, disclosure, or policy guardrails around outbound network access. This can leak request metadata such as user-agent, language preference, IP-derived location, and browsing targets to external parties, and the finance/news context makes silent retrieval from many third-party sources a real privacy and compliance concern.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill requires network-capable behavior such as fetching RSS feeds, webpages, and APIs, but it does not declare any tool scope or permissions. This creates an authorization and transparency gap: a host may expose broader capabilities than intended, and users cannot clearly verify what external access the skill expects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language instructions and examples center the skill in Chinese, and the sample request explicitly sets the request locale to zh-CN rather than offering a user choice. Under the policy, forcing a specific language or locale without opt-in is a violation unless clearly justified as region-specific, which is not documented here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to check for and prioritize the external curl command for data retrieval, which introduces subprocess execution and shell-adjacent behavior beyond ordinary content fetching. If URLs or headers become influenced by untrusted input, this pattern can expand the attack surface to command misuse, policy bypass, or data exfiltration through host tooling.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Mandating python3 scripts/format.py adds interpreter/process execution to the skill's behavior, increasing the attack surface beyond simple market-data analysis. Any local script execution can become dangerous if the script, its arguments, or fetched content are tampered with, potentially enabling unsafe code paths, excessive file access, or policy bypass.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill generates explicit buy/hold/sell recommendations without any warning that outputs are informational and not financial advice. This is risky because users may over-trust automated signals for consequential financial decisions, creating harm through misleading certainty or omitted limitations.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

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.

Content

Scanner excerpt · references/news_apis.md (reported line 34)May include surrounding context.

md
## 2. 指数接口

| 来源                  | URL                                                                                                                                                                   | 数据位置                                   |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| US10YTIP              | https://quote.cnbc.com/quote-html-webservice/restQuote/symbolType/symbol?symbols=US10YTIP&requestMethod=itv&noform=1&partnerId=2&fund=1&exthrs=1&output=json&events=1 | FormattedQuoteResult.FormattedQuote[].last |
| ICE U.S. Dollar Index | https://quote.cnbc.com/quote-html-webservice/restQuote/symbolType/symbol?symbols=.DXY&requestMethod=itv&noform=1&partnerId=2&fund=1&exthrs=1&output=json&events=1     | FormattedQuoteResult.FormattedQuote[].last |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file prescribes the skill's output format exclusively in Chinese, including all headings and field labels. Under the policy rules, forcing a specific language without user opt-in or an explicit justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a skill that turns real-time global news and key macro indicators into investment insights. This file instead accepts an arbitrary API URL and transforms Yahoo-style stock chart data fields such as symbol, regularMarketPrice, 52-week high/low, OHLC, and volume into JSON, with no handling of news items or macro indicators.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

A network request is issued directly to a user-controlled URL with no validation, confirmation, or restriction. In an agent or server environment, this can be abused to make requests to attacker-chosen hosts, including internal network endpoints or cloud metadata services, creating an SSRF risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The CLI accepts an arbitrary user-supplied URL and fetches it without restriction, making the script a generic network retriever rather than a narrowly scoped market-data formatter. In practice, this expands the attack surface and can enable SSRF-style access to internal services or unintended outbound requests when run in a trusted environment.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/format.py (reported line 67)May include surrounding context.

python
# sys.argv 是一个列表,第一个元素是脚本名,第二个元素才是传入的参数
    if len(sys.argv) < 2:
        print("错误: 请提供 API URL。")
        print('用法: python3 scripts/format.py "https://api.example.com/data"')
        sys.exit(1)

    # 获取命令行传入的第一个参数

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file describes automated collection from RSS feeds, web pages, and APIs, including use of scraping methods and an agent-browser skill, but it does not warn users that the skill may make outbound network requests to third-party sources. Because markdown files should disclose behaviors that may affect privacy or system integrity, a brief notice about external requests and data transmission is warranted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The sample request hard-codes the Accept-Language header to zh-CN, which overrides user preference and discloses a locale signal to third-party services. While lower severity than unrestricted fetching, it still creates unnecessary metadata leakage and can cause user-mismatched content or profiling when the skill performs network requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
67% confidence
Finding

规则要求检查自然语言中的语言/locale 策略问题。该文件从标题到说明均仅使用中文,未提供可选语言或说明这是面向特定中文用户群的区域化文档,因此存在强制特定语言的风险。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

这是一个 markdown 文件,适用缺少用户警告规则。文档直接提供多个第三方 RSS 与公共实例地址,并在后文继续提供 Yahoo Finance、CNBC、TradingEconomics 等外部接口,但没有任何关于访问第三方服务会暴露客户端 IP、请求元数据或受第三方条款约束的提示,属于隐私/网络访问方面的缺少说明。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

L105 明确指示“必须使用 scripts/format.py”处理 Yahoo Finance 接口返回数据,意味着技能执行过程中会主动访问外部服务。作为 markdown 技能说明,这里缺少对外部网络访问及第三方数据源依赖的用户提示。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file contains natural-language comments, docstrings, and CLI error/usage output only in Chinese. This enforces a specific language for user-visible interaction without any opt-in or alternative, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.