Back to skill

Security audit

持仓诊断

Security checks for vulnerabilities and agentic risk

Overview

This skill needs review because it is advertised as portfolio diagnosis but actually forwards financial prompts and API credentials to a remote Prana service and can store credentials locally.

Install only if you intentionally want a Prana-hosted remote portfolio analysis workflow. Avoid passing --base-url unless it is a trusted HTTPS Prana endpoint, prefer environment variables or PRANA_SKILL_SKIP_WRITE_API_KEY=1 instead of writing keys to disk, and treat any portfolio details entered into the skill as data sent off-host.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/prana_skill_client.py:461
Finding

API credentials and portfolio data can be transmitted to an arbitrary endpoint

Content
View full analysis
dict[str, str]: """Claw 接口要求:x-api-key 为 public_key:secret_key。""" return { "Content-Type": "application/json", "x-api-key": f"{public_key}:{secret_key}", } ``` Equivalent Node.js request: ```javascript const url = `${baseUrl.replace(/\/+$/, '')}/api/claw/agent-run`; const body = { skill_key: skillKey, question: content, thread_id: threadId || '', request_id: requestId, }; const opts = { method: 'POST', headers: headersXApiKey(publicKey, secretKey), body: JSON.stringify(body), signal: AbortSignal.timeout(HTTP_TIMEOUT_MS), }; ``` The caller-controlled destination is passed directly into credential loading and invocation: ```javascript const baseUrl = values['base-url'] || DEFAULT_PRANA_BASE; const [publicKey, secretKey] = await loadPranaCredentials(baseUrl); const requestId = randomUUID(); const content = buildInvokeContent(c ...[truncated 2652 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/prana_skill_client.py:267
Finding

Fetched API secrets are persisted in plaintext without restrictive file permissions

Content
View full analysis
None: """将 public_key:secret_key 写入 config/api_key.txt(首行为注释,与现有读取逻辑兼容)。""" CONFIG_DIR.mkdir(parents=True, exist_ok=True) lines = [ "# Auto-saved by prana_skill_client after GET /api/v1/api-keys; do not commit to public repos.", f"{public_key}:{secret_key}", "", ] API_KEY_FILE.write_text("\n".join(lines), encoding="utf-8") ``` Automatic persistence is enabled by default: ```python if fetched: pub, sec = fetched if not _skip_write_fetched_api_key(): try: _persist_fetched_api_key_txt(pub, sec) except OSError as e: print(f"警告: 无法写入 config/api_key.txt:{e}", file=sys.stderr) return pub, sec ``` Equivalent Node.js implementation: ```javascript function persistFetchedApiKeyTxt(publicKey, secretKey) { fs.mkdirSync(CONFIG_DIR, { recursive: true }); const lines = [ '# Auto-saved by prana_skill_client after GET /api/v1/api-keys; do not commit to public repos.', `${publicKey}:${secretKey}`, '', ]; fs.writeFileSync(API_KEY_FILE, lines.join('\n'), 'utf8'); } ``` ```javascript if (fetched) { const [pub, sec] = fetched; if (!skipWriteFetchedApiKey()) { try { persistFetchedApiKeyTxt(pub, sec); } catch (e) { console.error(`警告: 无法写入 config/api_key.txt:${e && e.message ? e.message : e}`); } } return [pub, sec]; } ``` ### Technical Analysis After retrieving an API key, both clients store the reusable `public_key:secret_key` credential as plaintext in the project directory. Persistence occurs by default unless `PRANA_SKILL_SKIP_WRITE ...[truncated 1789 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (23)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README describes a generic Prana thin client that forwards user input and local credentials to a remote service, not a self-contained portfolio diagnosis skill as advertised. This mismatch is dangerous because it can mislead users and reviewers into granting sensitive financial prompts, API keys, and trust to a package whose real behavior is opaque and remotely controlled.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The README explicitly states that the package contains no business implementation and that the actual logic resides server-side, directly contradicting the advertised portfolio-analysis functionality. For a finance-related skill, this prevents meaningful inspection of what advice logic, data collection, or hidden actions occur remotely, creating a substantial supply-chain and transparency risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A finance-analysis skill that instead behaves like a general remote-service client with credential read/pull and local secret storage is an especially severe description-behavior mismatch. In this context, users are likely to provide sensitive portfolio information under the assumption of analytics, making undisclosed remote execution and secret persistence much more dangerous due to privacy, account, and supply-chain risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A finance-analysis skill that instead behaves like a general remote-service client with credential read/pull and local secret storage is an especially severe description-behavior mismatch. In this context, users are likely to provide sensitive portfolio information under the assumption of analytics, making undisclosed remote execution and secret persistence much more dangerous due to privacy, account, and supply-chain risks.

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 25)May include surrounding context.

md
- **Node.js 18+**:先在包根目录执行 **`npm install`**,再执行 `node scripts/prana_skill_client.js -m "…" [-t thread_id] [-b base_url]`

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code does not implement the advertised portfolio-diagnosis logic locally; instead it acts as a thin proxy that forwards user input to a remote Prana service for execution. This creates a trust-boundary mismatch: users and reviewers cannot inspect the real behavior, data handling, or downstream actions of the actual skill implementation, which is especially risky for financial prompts and holdings data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README instructs the client to automatically fetch API credentials and write them to config/api_key.txt, increasing the chance of local secret exposure through weak filesystem permissions, accidental inclusion in archives, logs, backups, or later repository commits. While there is a brief security note elsewhere, the risk is not emphasized at the point where automatic persistence is introduced, making unsafe credential handling more likely.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill advertises executable client paths and static analysis indicates code capabilities including environment access, file read/write, and network access, yet the manifest declares no tool scope or permission boundaries. This creates a transparency and confinement problem: a user invoking a benign-looking portfolio skill could trigger code with broad local and network access without explicit disclosure or least-privilege restrictions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Overly broad trigger phrases can cause the skill to activate during ordinary investing conversations, which is risky when the skill appears to have undeclared network and file capabilities. Unintended activation increases the chance that user portfolio data or local/runtime secrets are processed by a skill the user did not knowingly invoke.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Ambiguous triggers without clear boundaries or exclusions make accidental invocation more likely, which compounds the risk from the skill's apparent hidden capabilities and behavior mismatch. In a finance context, accidental activation can expose sensitive holdings data and initiate unintended remote operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This plain-text file contains all operational instructions in Chinese, including how to store credentials and invoke related API-key retrieval behavior. The policy requires flagging language or locale constraints when a skill forces a specific language without user opt-in, and no alternative language or choice is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JavaScript client emits user-facing errors, warnings, help text, and status messages entirely in Chinese, starting with the first visible message at L077 and continuing throughout the file. That constitutes a language/locale policy issue because the skill does not offer user opt-in or any mechanism to select another language.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This wrapper does more than invoke a portfolio-diagnosis skill: if credentials are absent, it automatically requests platform API keys from a remote endpoint and then may persist them locally. For a public skill client, expanding scope into credential acquisition and storage increases the attack surface, can surprise operators, and may expose reusable platform credentials through filesystem compromise, accidental commits, or misuse by other local processes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code writes fetched API credentials to config/api_key.txt by default, creating long-lived local secret storage in a skill whose primary function is portfolio analysis. Plaintext local persistence raises the risk of credential leakage via source control mistakes, backups, shared hosts, permissive file permissions, malware, or other users on the same system.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring and later user-facing messages are exclusively in Chinese, and there is no indication that users may select another language. Under the stated policy, forcing a language or locale without opt-in is a natural-language policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The client automatically sends user messages and skill metadata to a remote service, but there is no explicit runtime warning or consent prompt describing what data leaves the local environment. In the context of a portfolio-diagnosis skill, user inputs may contain sensitive financial holdings, risk tolerance, and account-related information, making undisclosed transmission more dangerous.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script can automatically fetch API credentials from a remote endpoint and persist them to config/api_key.txt on disk. Storing long-lived credentials locally expands the attack surface: other local users, malware, backups, or accidental repository commits could expose the keys, enabling unauthorized access to the remote service.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description is framed around broad, natural investment phrases that are likely to appear in ordinary user conversation, which can cause the skill to activate without clear user intent to invoke this specific capability. In a finance context, unintended activation is more sensitive because it may process portfolio-related data, perform network-backed analysis, and deliver investment-style guidance when the user did not explicitly request this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger keyword list contains generic phrases like asking whether positions are reasonable or whether holdings have problems, which overlap heavily with normal investment discussion. This increases the risk of accidental routing to the skill, leading to unintended use of network/file permissions and potentially exposing or acting on sensitive financial context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language interface, including description, input instructions, and trigger phrases, is presented exclusively in Chinese. This effectively imposes a language constraint without user opt-in or an explicit statement that the skill is intentionally limited to a Chinese-speaking or A-share-specific audience.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a caret range (^2.6.1), which allows installation of different patch and minor releases over time. This weakens build reproducibility and can unintentionally pull in a vulnerable or breaking version, especially in a skill that may parse external YAML content in the Node runner environment.

Content

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

json
"type": "module",
  "description": "Prana encapsulated skill — install deps for the Node runner: npm install",
  "dependencies": {
    "yaml": "^2.6.1"
  },
  "engines": {
    "node": ">=18.0.0"

Unverifiable Dependency: yaml has 2 known advisory(ies) (CVE-2026-33532 (yaml is vulnerable to Stack Overflow via deeply nested YAML collections); CVE-2023-2251 (Uncaught Exception in yaml)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The manifest references yaml without pinning an exact version, while known advisories exist for some yaml releases, including denial-of-service conditions such as stack overflow or uncaught exceptions during parsing. Because the installed version is not fixed or evidenced by a lockfile here, consumers may resolve to an affected release, which is more concerning if the skill or runner processes untrusted YAML input.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language description and all example trigger phrases are exclusively in Chinese, with no indication that other languages are supported or that the user can choose a preferred language. This can violate language-choice policy when the skill implicitly requires a specific language without documenting it as an opt-in or justified locale restriction.

Content

No source excerpt is available for this finding.