Back to skill

Security audit

rag-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated remote knowledge-base purpose, but it handles an API key unsafely and declares an unrelated purchase-history endpoint.

Review this skill before installing. Use it only for non-sensitive knowledge-base questions, prefer temporary secret injection over global storage when practical, do not print PRANA_SKILL_API_FLAG in terminal output, and avoid the purchase-history endpoint unless you explicitly need that account-related link.

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
SKILL.md:64
Finding

API Key Disclosure Through Environment Variable Inspection

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 64–66
Vulnerability Type: Sensitive credential exposure through terminal output
Risk Level: Medium

Vulnerable Code

bash
env | grep PRANA_SKILL_API_FLAG

Technical Analysis

The documented workflow checks whether PRANA_SKILL_API_FLAG exists by printing the matching environment entry. Because env emits both the variable name and its complete value, this command exposes the API key in plaintext.

The disclosed value may be captured in agent transcripts, terminal scrollback, command-execution logs, CI output, screen recordings, or diagnostic reports. This behavior is unnecessary because the workflow only needs to determine whether the variable is present; it does not need to read or display its value.

The same document later recommends storing the credential in global configuration. Persistent storage can increase the duration and scope of exposure if the configuration is readable by other local users or included in backups, although the actual storage permissions of openclaw config are not defined in the audited project.

Attack Path

  1. A user or agent follows Step 1 of the documented workflow.
  2. The shell executes env | grep PRANA_SKILL_API_FLAG.
  3. The complete API key is printed to standard output.
  4. The output is retained in a transcript, terminal log, CI log, diagnostic capture, or other accessible record.
  5. An unauthorized party obtains the exposed key.
  6. That party reuses the key as the x-api-key header against the declared Prana endpoints, subject to the permissions and server-side controls associated with that credential.

Impact Assessment

Successful exploitation discloses the Prana API credential available to the current process. An attacker may gain the ability to submit remote agent tasks, query task results, or access other API functionality authorized for that key. The precise privilege scope depends ...[truncated 264 chars]

Remediation
View remediation

Remediation Suggestions

Replace the value-printing command with a presence-only check:

bash
if [ -n "${PRANA_SKILL_API_FLAG:-}" ]; then
  echo "PRANA_SKILL_API_FLAG is configured"
else
  echo "PRANA_SKILL_API_FLAG is not configured"
fi

Additional hardening measures:

  1. Never print, log, or include the complete API key in chat responses or diagnostic output.
  2. Prefer runtime secret injection or an operating-system secret manager over plaintext global configuration.
  3. If persistent storage is required, document and enforce restrictive file permissions and exclude the configuration from backups, telemetry, and support bundles where appropriate.
  4. Redact the credential from process output and error reports.
  5. Provide a documented key-revocation and rotation procedure for suspected disclosure.
  6. Use session-scoped storage by default and require explicit informed consent before persistent storage.
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The stated scope implies access to a specific curated knowledge base, yet the implementation path relies on external agent-run and agent-result endpoints without any verifiable linkage to that dataset. This creates a deceptive abstraction where arbitrary remote processing may occur, potentially exposing user prompts or secrets to a broader backend than expected.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The stated scope implies access to a specific curated knowledge base, yet the implementation path relies on external agent-run and agent-result endpoints without any verifiable linkage to that dataset. This creates a deceptive abstraction where arbitrary remote processing may occur, potentially exposing user prompts or secrets to a broader backend than expected.

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

md
NODE_OPTIONS=--experimental-default-type=module node scripts/prana_skill_client.js -q "请从知识库中查找RAG相关的技术文档"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 219)May include surrounding context.

md
NODE_OPTIONS=--experimental-default-type=module node scripts/prana_skill_client.js -q "请从知识库中查找RAG相关的技术文档"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares network and environment-variable behavior but does not define explicit tool scope restrictions such as allowed tools or permissions. In practice, this leaves a powerful skill under-specified: it can inspect environment state and interact with external services, increasing the chance of unauthorized secret handling or unintended remote operations if the runtime grants broad defaults.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill name is entirely in Chinese, and the document consistently instructs usage and example queries in Chinese without any statement that the user may choose another language. This creates a natural-language policy concern because it implicitly forces a locale rather than offering opt-in or multilingual flexibility.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description says to use the skill 'when the user needs to get RAG-related content from the knowledge base,' which is a wide natural-language condition without explicit trigger phrases, exclusions, or scope limits. In a markdown/manifest context, this can overlap with many ordinary retrieval requests and makes it unclear when the skill should activate versus when a general-answering skill should handle the request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script sends user-provided question content and request IDs to a remote service but its CLI help and runtime messaging do not clearly disclose that this data leaves the local environment. In a knowledge-base retrieval skill, prompts may contain sensitive internal context, so the lack of explicit notice can lead to unintended disclosure to an external endpoint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill description is broad enough that it may trigger for loosely related knowledge requests without clear boundaries, increasing the chance of over-invocation and unnecessary remote data transmission. In this context, broad activation is more concerning because the skill performs authenticated remote requests and the metadata already shows scope creep in declared endpoints.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest for a RAG knowledge-retrieval skill declares access to a purchase-history URL that is unrelated to answering knowledge-base queries. This expands the skill’s reachable data surface beyond its stated purpose and creates unnecessary exposure to potentially sensitive account or transaction metadata if the endpoint is ever invoked or abused.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

Access to purchase-history data is unjustified for the stated function of querying a knowledge base about RAG content. This violates least-privilege design and could enable unauthorized access to nonessential sensitive information, especially since the same API key environment variable is used across endpoints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Comments, help text, and error messages are presented only in Chinese, and the script provides no option for users to select another language. This creates a natural-language policy concern because it imposes a locale/language choice without opt-in or justification.

Content

No source excerpt is available for this finding.