Back to skill

Security audit

Dataify Google Finance

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Dataify Google Finance API wrapper with disclosed external API use, though users should avoid passing tokens on the command line.

Install only if you are comfortable sending finance search parameters to Dataify's scraper API and using a Dataify API token. Prefer setting DATAIFY_API_TOKEN through your shell or secret manager, never paste the token into chat or pass it with --token, and monitor Dataify credit usage because successful calls may consume account credits. Expect some Chinese-localized messages or documentation inconsistencies in edge cases.

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/google_finance.py:159
Finding
API Token Exposure Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/google_finance.py`, lines 159 and 492–499; invocation at lines 549–550 **Vulnerability Type**: API credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```python parser.add_argument("--token", help="Dataify API token. Bearer prefix is optional.") ``` ```python def get_authorization(token_arg: str | None) -> str | None: token = clean_value(token_arg) or clean_value(os.environ.get("DATAIFY_API_TOKEN")) if not token: return None if not token.lower().startswith("bearer "): token = f"Bearer {token}" os.environ["DATAIFY_API_TOKEN"] = token return token ``` ```python authorization = get_authorization(args.token) if not authorization: print("缺少 Dataify API token,请提供 token,或前往 https://dashboard.dataify.com/login?utm_source=skill 注册获取;新账号注册即得 50 免费积分。", file=sys.stderr) return 2 ``` ### Technical Analysis The script accepts the Dataify API token through the `--token` command-line option. Secrets supplied in command-line arguments may become visible through process inspection interfaces, process-monitoring software, diagnostic telemetry, command histories, CI/CD logs, or Agent execution logs. The script already supports the comparatively safer `DATAIFY_API_TOKEN` environment variable, so accepting the same credential through a command-line argument is not necessary for the declared Google Finance functionality. The token is not sent to an arbitrary destination: it is used as the `Authorization` header for the fixed HTTPS endpoint `https://scraperapi.dataify.com/request`. Consequently, the identified vulnerability concerns local credential exposure rather than hidden network exfiltration. The assignment of the normalized bearer token back into `os.environ` also unnecessarily expands its availability to any child process launched later in the same process context, although this script currently does not launch subprocesses. ...[truncated 1339 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--token` command-line option and obtain the credential only from `DATAIFY_API_TOKEN` or an operating-system credential store. 2. If interactive credential entry is required, read it with a non-echoing prompt such as `getpass.getpass()` rather than placing it in the argument vector. 3. For automation, use the CI/CD platform's protected secret injection mechanism and ensure command tracing is disabled around credential handling. 4. Do not assign the normalized bearer value back to `os.environ`. Keep it in a local variable and pass it directly to the request-building function. 5. Ensure logs, diagnostics, and exception messages never include the `Authorization` header or token value. 6. Document that users must never place tokens directly in shell commands, scripts, chat messages, or checked-in configuration files. 7. Rotate any credential previously supplied through `--token` if command history, process telemetry, or execution logs may have recorded it. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared purpose is a simple Google Finance search helper, but the skill behavior includes local file/script inspection and parameter-table generation, while the actual finance querying appears delegated or absent from the described logic. This mismatch can mislead users and security systems about what the skill really does, reducing transparency and making it easier to smuggle higher-risk capabilities under a benign description.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill instructs the agent to read local files, inspect scripts, check environment variables, and make networked API calls, yet it declares no explicit tool scope or permission boundaries. This creates an authorization gap where an agent may over-assume allowed capabilities, increasing the risk of unintended file access, environment inspection, or outbound requests beyond what users expect from a finance lookup skill.

Vague Triggers

Medium
Confidence
95% confidence
Finding
L003 除了列出较具体的触发短语外,还写明“或明确提到金融数据相关内容(股票、指数、基金、货币、期货)时”即触发。该条件覆盖面很广,可能与日常金融讨论或一般性问答重叠,且未说明不应触发的边界或负例。

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
L043 instructs the agent to return the script output directly and explicitly forbids summarizing, extracting, cleaning, translating, or reformatting the API response body. However, L079-L081 says the default behavior is to return concise processed results and only provide raw JSON/HTML when explicitly requested, which is an active contradiction in the skill's own documentation about what the code/output flow should do.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
L043 指示“将脚本输出直接返回给用户。不要对 API 响应体进行…翻译”,这会在用户使用其他语言交互时强制保留原始语言输出,而未提供语言选择或用户 opt-in。根据语言/locale 政策,这属于未经用户选择的语言约束。

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## Account CTA policy

- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## Account CTA policy

- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.
- For an invalid token, direct the user to API-key management without implying that a new registration is required. For insufficient credits, direct the user to balance or recharge management.
- During normal submission, processing, and successful completion, do not promote registration or the Dashboard. Never expose the token or include it in CTA attribution parameters.
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.
- For an invalid token, direct the user to API-key management without implying that a new registration is required. For insufficient credits, direct the user to balance or recharge management.
- During normal submission, processing, and successful completion, do not promote registration or the Dashboard. Never expose the token or include it in CTA attribution parameters.
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The instruction to omit the Authorization header from the pre-call confirmation table reduces transparency around a sensitive credential being sent to a third-party endpoint. This can cause users to approve a request without realizing an API token will be transmitted, increasing the risk of accidental credential disclosure or misuse if the skill is invoked in a sensitive context.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Multiple user-facing descriptions and error/help messages are written in Chinese, and the script does not offer an opt-in or configurable interface language for those messages. This can violate a language/locale policy when users are not explicitly given a choice of output language.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Content
params[key] = cleaned

    for field in FIELDS:
        value = clean_value(getattr(args, field))
        if value is not None:
            params[field] = value
Confidence
50% confidence
Finding
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Context-Inappropriate Capability

Low
Confidence
84% confidence
Finding
The manifest describes a skill whose purpose is searching Google Finance for market instruments. While making an HTTP request is expected, reading credentials from process environment and then writing the normalized bearer token back into the environment is a broader credential-handling capability that is not justified by the stated end-user purpose of finance search.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This code posts normalized request parameters, including the user's finance query and optional language setting, to a third-party Dataify endpoint. Although the module docstring says it calls the API, there is no runtime print/log/confirmation immediately before transmission to disclose that user input is being sent off-system.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The script emits user-facing error messages only in Chinese for invalid JSON input and type validation. This imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria.

Static analysis

No suspicious patterns detected.