Back to skill

Security audit

Eastmoney Financial Search

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a financial-news search helper, but it embeds a shared API key and sends and saves user queries with limited user control.

Review before installing. Do not submit confidential investment research, internal company names, or regulated data unless you are comfortable sending those queries to the Eastmoney API. Prefer a user-controlled, scoped API key and treat the embedded default key as exposed. Be aware that the helper script writes query results to local text files in the working directory.

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/query_eastmoney.py:9
Finding

Hard-Coded Eastmoney API Credential Exposed in Source Code and Documentation

Content
View full analysis
": print("❌ 请设置 EASTMONEY_APIKEY 环境变量") return None ``` `SKILL.md:11-13`: ```markdown ## 环境变量 - `EASTMONEY_APIKEY`: 东方财富 API key (默认:`mkt_Z19TUfMY79_44k4wZsAHIVGVva0-g8PxD_DkBDQx2iM`) ``` `SKILL.md:41-44`: ```python def get_eastmoney_news(query): apikey = os.environ.get("EASTMONEY_APIKEY", "mkt_Z19TUfMY79_44k4wZsAHIVGVva0-g8PxD_DkBDQx2iM") ``` ### Technical Analysis A reusable Eastmoney API key is embedded directly in both the executable source code and its documentation. The environment-variable lookup does not protect the credential because the disclosed value is used as a functional fallback whenever `EASTMONEY_APIKEY` is absent. Secrets committed to distributed source files must be treated as compromised. Any person or automated scanner with access to the skill package can recover the key without executing the code. The key can then be supplied directly to the documented Eastmoney endpoint from an unrelated system. The existing absence check is ineffective for this exposure: because the hard-coded fallback is nonempty and does not equal the placeholder string, execution proceeds with the exposed credential. ### Attack Path 1. An attacker downloads or otherwise reads the skill package. 2. The attacker extracts the API key from `scripts/query_eastmoney.py` or `SKILL.md`. 3. The attacker constructs requests to the documented endpoint: `https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search`. 4. The attacker places the extracted ...[truncated 919 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Tainted flow: 'req' from os.environ.get (line 24, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/query_eastmoney.py (reported line 31)May include surrounding context.

python
)
    
    try:
        with urllib.request.urlopen(req, timeout=10) as response:
            result = json.loads(response.read().decode("utf-8"))
            return result
    except Exception as e:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill publishes and uses a hardcoded default API key, which encourages credential reuse and exposes the secret to anyone who can read the skill file. Even if the key is intended for low-sensitivity access, embedding it in documentation and code makes unauthorized use, quota theft, and uncontrolled third-party requests more likely.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

A hardcoded default API key in the skill definition can lead to credential disclosure and shared-secret reuse across multiple users or deployments. If the key is active, others can consume the associated service, exhaust quotas, attribute abuse to the owner, or rely on an unmanaged credential with unknown trust boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill description and API documentation show that user-provided queries are sent to an external Eastmoney endpoint, but they do not clearly warn users that their input leaves the local environment. This creates a privacy and data-handling risk because users may submit sensitive financial research, company names, or internal investigative queries without understanding they are transmitted to a third party.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example code contains a credential fallback to a literal API key, which increases the chance that the secret will be copied into logs, derivative projects, responses, or redistributed skill bundles. Sample code is often reused verbatim, so this pattern propagates insecure credential handling into downstream environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends user-provided query text to an external third-party service without explicit notice or consent at the point of transmission. In a financial-news skill, queries may contain sensitive investment interests, company research topics, or internal terms, so silent transmission creates a privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script automatically persists the query and returned content to a local file without prior warning or consent. Because the query may encode sensitive financial interests or research topics, unannounced local storage can expose information to other local users, backups, or logging/collection systems.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The inline comment on L72 explicitly states that the query will come from command-line arguments or an environment variable. However, L73-L76 only handle command-line arguments and otherwise call input(), so the documented behavior contradicts the implemented behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.