Back to skill

Security audit

xhcj-finance

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Xinhua Finance data CLI with some credential-handling and dependency-hardening issues, but no hidden, destructive, or unrelated behavior was found.

Install only if you are comfortable using a Chinese-market finance CLI that sends requests to the documented Xinhua Finance endpoint. Avoid putting real API keys directly in shared shell commands, scripts, logs, or CI output, and prefer a reviewed release with a lockfile and improved credential handling.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:21
Finding

API Key Exposed Through Command-Line Arguments and Shell History

Content
View full analysis
', 'API key for Xinhua Finance API'); ``` The documented invocation explicitly places the credential in a command-line argument: ```bash xhcj-finance --api-key market --symbol ``` ### Technical Analysis The CLI accepts sensitive API credentials through the `--api-key` command-line option. Depending on the operating system and shell configuration, command-line arguments may be exposed through: - Shell history files. - Process inspection utilities and process metadata. - Monitoring, diagnostics, or endpoint telemetry. - Terminal logs and copied command output. - Wrapper scripts or CI job logs. The implementation subsequently hashes the supplied value using MD5 and clears the JavaScript variable, but those operations do not remove copies already stored in process arguments, shell history, or external telemetry. There is also a correctness defect at `index.js:28-37` and `index.js:229`: `program.opts()` is called before `program.parse(process.argv)`. As a result, the current implementation normally fails to retrieve the provided key and rejects requests as unauthenticated. This limits normal API use but does not prevent the plaintext key from appearing in the invoking shell's history or the process command line. ### Attack Path 1. A user follows the documented instructions and invokes the CLI with a valid plaintext API key: ```bash xhcj-finance --api-key xhcj_ market --symbol 600000.SS ``` 2. The shell records the complete command in its history, or the operating system exposes it ...[truncated 945 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
package.json:20
Finding

Non-Reproducible Dependency Installation Without a Lockfile

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This README presents all user-facing instructions and usage guidance only in Chinese, which effectively forces a specific language on users without opt-in. The policy allows locale constraints when explicitly documented and justified, but no such justification or alternative language option is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file presents the skill description, usage, parameters, examples, and notes only in Chinese. This can violate language/locale policy when users are not given an opt-in choice or an explicit statement that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code irreversibly hashes the user-supplied API key with MD5, discards the original value, and then sends the hash as the Bearer token. This is not secure storage or secure transmission; it changes the credential entirely and may cause authentication failure while also misleading maintainers into believing the secret is being protected cryptographically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code embeds user-facing descriptions and examples such as "A股股票代码" and Chinese stock/news terminology in command options, which effectively requires Chinese-language comprehension. The file does not offer an English alternative, user opt-in, or an explicit justification that the tool is intended only for a Chinese-language or region-specific audience.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This manifest file only describes the skill as "财经数据查询" (financial data query), which is broad and does not specify concrete activation phrases, boundaries, or exclusion conditions. In a manifest context, such a generic description can overlap with many ordinary finance-related requests and may lead to unintended invocation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Using a caret range for axios allows future compatible releases to be installed without explicit review, which weakens supply-chain control and can unexpectedly introduce vulnerable or malicious code. In a tool that queries remote finance data, network-facing dependencies are part of the trust boundary, so uncontrolled upgrades increase risk.

Content

Scanner excerpt · package.json (reported line 21)May include surrounding context.

json
"license": "ISC",
  "type": "commonjs",
  "dependencies": {
    "axios": "^1.13.6",
    "commander": "^14.0.3"
  }
}

Unverifiable Dependency: axios has 16 known advisory(ies) (CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The manifest references axios with a non-exact version while the package family has multiple known advisories, so reviewers cannot verify from this file whether installations resolve to a safe release. Because axios is commonly used for outbound HTTP requests, affected versions can expose the skill to issues such as SSRF, MITM-related abuse, or response manipulation depending on usage in code.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
87% confidence
Finding

Using a caret range for commander means the installed CLI framework version may change over time without deliberate validation. While this is a lower-risk library than an HTTP client, it still creates avoidable supply-chain exposure and reduces build reproducibility.

Content

Scanner excerpt · package.json (reported line 22)May include surrounding context.

json
"type": "commonjs",
  "dependencies": {
    "axios": "^1.13.6",
    "commander": "^14.0.3"
  }
}

Static analysis

No suspicious patterns detected.