Back to skill

Security audit

gold-analysis

Security checks for vulnerabilities and agentic risk

Overview

This gold analysis skill mostly matches its stated purpose, but it ships and automatically uses a shared Tavily API key for external searches, so it needs review before installation.

Install only if you are comfortable with gold-analysis queries being sent to Tavily. The embedded shared API key should be removed and rotated by the publisher; prefer a version that requires your own TAVILY_API_KEY and clearly confirms external lookup before use. Treat its market signals as informational, not personal 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

Error
Location
scripts/search-gold.mjs:51
Finding
Hard-Coded Shared Tavily API Credential## Vulnerability Details **File Location**: `scripts/search-gold.mjs`, lines 51–53 **Vulnerability Type**: Hard-coded API secret / plaintext sensitive credential **Risk Level**: High ### Vulnerable Code ```js const DEFAULT_API_KEY = "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"; const apiKey = (process.env.TAVILY_API_KEY ?? DEFAULT_API_KEY).trim(); ``` The related documentation in `SKILL.md`, lines 15–21, explicitly advertises the embedded credential as a fallback: ```md **Optional environment variable:** - `TAVILY_API_KEY` - Tavily API key (optional; the built-in default key is used when unset) > A default API key is built in as a fallback. ``` ### Technical Analysis A live-looking Tavily API credential is stored directly in the distributed source code and is automatically selected whenever `TAVILY_API_KEY` is not configured. Secrets embedded in a Skill package cannot be kept confidential because every user or attacker with access to the package can inspect and extract them. The fallback also causes separate installations to share one credential, eliminating effective per-user isolation and attribution. No source-code exploit is required: possession of the package is sufficient to recover the token and use it independently of the Skill. ### Attack Path 1. An attacker downloads or otherwise obtains the Skill package. 2. The attacker opens `scripts/search-gold.mjs` and extracts the token assigned to `DEFAULT_API_KEY`. 3. The attacker submits arbitrary requests directly to the Tavily API using the extracted credential. 4. Requests are charged against, rate-limited under, or attributed to the credential owner. 5. Sustained use may consume the available quota, generate costs, trigger abuse controls, or cause the provider to revoke the credential. 6. Revocation can disrupt every legitimate installation that relies on the shared fallback token. ### Impact Assessment This issue grants unauthorized use of the Tavily API privileges associated ...[truncated 657 chars]
Remediation
## Remediation Suggestions 1. Immediately revoke and rotate the exposed Tavily API credential. Removing it from the current source alone is insufficient because it may remain in distributed copies or repository history. 2. Delete `DEFAULT_API_KEY` and require callers to provide `TAVILY_API_KEY` through an approved secret-management mechanism. 3. Fail safely with a clear error when the environment variable is missing, for example: ```js const apiKey = process.env.TAVILY_API_KEY?.trim(); if (!apiKey) { console.error("Error: TAVILY_API_KEY is required."); process.exit(1); } ``` 4. Update `SKILL.md` and its metadata so that `TAVILY_API_KEY` is documented as mandatory rather than optional. 5. Store deployment credentials in a secret manager or protected runtime configuration, never in source code, examples, package artifacts, logs, or documentation. 6. Where supported by the provider, apply least-privilege scopes, account-level spending limits, restrictive quotas, key expiration, and usage alerts. 7. Review API access logs for unauthorized activity involving the exposed token and rotate any related credentials if compromise is suspected. 8. Add automated secret scanning to source-control and release pipelines to prevent future credential exposure.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill documents use of environment variables and external network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. That makes the skill's operational capabilities less transparent and weakens policy enforcement, increasing the chance of unintended external requests or access to secrets during execution.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger description is broad enough to match many ordinary conversations about gold prices, investing, or news, which can cause the skill to activate unexpectedly. Because the skill performs external search, over-broad activation increases the risk of sending user content to third parties without clear intent or necessity.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
Allowing a built-in default Tavily API key means the skill can make authenticated third-party requests even when the deployer has not intentionally configured credentials. This bypasses normal trust and consent boundaries, creates hidden credential usage, and can expose the platform to key abuse, billing risk, and uncontrolled data transmission to an external service.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill describes use of Tavily API search but does not warn that user queries or derived prompts may be transmitted to an external provider. This omission undermines informed consent and can lead to privacy leakage, especially when users ask sensitive financial questions that they may not expect to leave the local assistant environment.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The example phrases are vague and encourage activation on common requests like 'analyze gold' or 'can I buy gold now,' without clarifying when external lookup will occur. In context, this raises privacy and control concerns because normal conversational prompts may automatically invoke networked behavior.

Context-Inappropriate Capability

Medium
Confidence
99% confidence
Finding
The script embeds a hardcoded fallback Tavily API key and automatically uses it when the environment variable is absent. Shipping live credentials inside distributable code enables unauthorized reuse, quota theft, and potential billing abuse by anyone who can read or copy the skill, which is unrelated to user-local gold analysis and expands the trust boundary unnecessarily.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The fallback credential is consumed silently, so users and operators may not realize the script is authenticating with an embedded third-party API key. This reduces transparency, impedes consent and governance, and can mask insecure credential practices until abuse or billing anomalies occur.

External Transmission

Medium
Category
Data Exfiltration
Content
include_raw_content: false,
  };

  const resp = await fetch("https://api.tavily.com/search", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
include_raw_content: false,
  };

  const resp = await fetch("https://api.tavily.com/search", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The file provides concrete technical trading signals such as RSI overbought/oversold thresholds, MACD golden/death crosses, and support/resistance guidance without any disclaimer that this is educational material rather than investment advice. In the context of a gold investment analysis skill, users may reasonably act on these signals as actionable financial guidance, increasing the risk of harmful financial decisions.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The natural-language content is entirely in Chinese, which can amount to a language policy issue when a skill or reference forces a single language without user opt-in or justification. There is no indication that the file is intentionally region-specific or that alternative language support is available.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
The file includes Chinese-only descriptive text in the header comment, which imposes a specific language choice in the skill's natural-language content without offering an alternative or opt-in. Under the stated policy, forcing a specific language without user choice can be a locale/language policy issue.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/search-gold.mjs:53