Back to skill

Security audit

Ragtop Agent

Security checks for vulnerabilities and agentic risk

Overview

This RAG skill has a coherent purpose, but it defaults to sending bearer-token API calls and user queries over unencrypted HTTP.

Review this skill before installing. It is not showing malware-like behavior, but you should only use it with a trusted RAGTOP endpoint, prefer HTTPS, avoid sending confidential prompts unless the backend is approved for that data, and use a narrowly scoped token that can be rotated if exposed.

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
SKILL.md:15
Finding
Bearer API Token Transmitted over Unencrypted HTTP## Vulnerability Details **File Location**: `SKILL.md:15-27` **Additional Affected Call Sites**: `SKILL.md:35-39`, `SKILL.md:50-58`, `references/workflow.md:8`, `references/workflow.md:14`, `references/workflow.md:29` **Vulnerability Type**: Plaintext transmission of sensitive credentials **Risk Level**: High ### Vulnerable Code ```markdown - `RAGTOP_API_URL`: RAGTOP API base URL. Defaults to `http://10.71.10.71:9380` if not set. - `RAGTOP_API_TOKEN`: Your RAGTOP API access token. Can be configured via the OpenClaw Web UI. ## 1. 核心工具构建指南 (How to build curl) 在调用以下接口前,请确保已获取环境变量 `${RAGTOP_API_URL}` 和 `${RAGTOP_API_TOKEN}`。如果 `${RAGTOP_API_URL}` 为空,请使用默认值 `http://10.71.10.71:9380`。 ### A. 列出知识库 (list_kb) 用于获取所有可用的 `knowledge_id`。 ```bash curl -L -X POST "${RAGTOP_API_URL}/api/v1/ragtop/tool/list_kb" \ -H "Authorization: Bearer ${RAGTOP_API_TOKEN}" \ -H "Content-Type: application/json" ``` ``` The workflow repeats the same authenticated request pattern: ```markdown - **动作**: 调用 `curl -X POST "${RAGTOP_API_URL}/api/v1/ragtop/tool/list_kb" -H "Authorization: Bearer ${RAGTOP_API_TOKEN}"`。 ``` ### Technical Analysis The Skill defaults `RAGTOP_API_URL` to an `http://` endpoint and instructs the agent to send `RAGTOP_API_TOKEN` through the HTTP `Authorization` header. HTTP does not provide transport encryption, endpoint authentication, or message integrity. Consequently, the bearer token, user-derived search queries, document identifiers, retrieved knowledge-base content, and API responses can be observed or modified by an attacker with a suitable network position. Because a bearer token grants access to whoever possesses it, interception is sufficient for impersonation; no additional secret is required. The issue affects all documented API operations that inherit the default URL, including knowledge-base enumeration, document enumeration, and semantic retrieval. ### Attack Path 1. `RAGTOP_AP ...[truncated 1559 chars]
Remediation
## Remediation Suggestions 1. Replace the HTTP default with an HTTPS endpoint: ```markdown Defaults to `https://ragtop.example.internal:9380` if not set. ``` 2. Reject any configured URL whose scheme is not `https`, rather than silently accepting or falling back to plaintext HTTP. 3. Preserve TLS certificate verification in `curl`; do not add `-k` or `--insecure`. 4. Deploy a certificate whose identity matches the configured RAGTOP hostname and whose issuing authority is trusted by the execution environment. 5. If a private certificate authority is required, configure its CA bundle explicitly instead of disabling verification. 6. Use narrowly scoped, short-lived API tokens with only the permissions needed for listing and retrieval operations. 7. Rotate or revoke tokens that may previously have been transmitted through the documented HTTP endpoint. 8. Avoid logging command traces, expanded environment variables, or Authorization headers. 9. Consider adding connection timeouts and restricting redirects, because `curl -L` can follow redirects; ensure credentials are never forwarded to an untrusted destination. 10. Update both `SKILL.md` and `references/workflow.md` so every example explicitly requires secure transport.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (7)

Credential Access

High
Category
Privilege Escalation
Content
The following environment variables are required:

- `RAGTOP_API_URL`: RAGTOP API base URL. Defaults to `http://10.71.10.71:9380` if not set.
- `RAGTOP_API_TOKEN`: Your RAGTOP API access token. Can be configured via the OpenClaw Web UI.

## 1. 核心工具构建指南 (How to build curl)
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly instructs the agent to send user requests and an authorization bearer token to a backend service, but it provides no user-facing notice, consent step, or data-handling warning. This is dangerous because user prompts, retrieved content, and scoped identifiers may be transmitted off-model to an external system without the user's awareness, creating privacy and data-governance risk.

External Transmission

Medium
Category
Data Exfiltration
Content
### A. 列出知识库 (list_kb)
用于获取所有可用的 `knowledge_id`。
```bash
curl -L -X POST "${RAGTOP_API_URL}/api/v1/ragtop/tool/list_kb" \
     -H "Authorization: Bearer ${RAGTOP_API_TOKEN}" \
     -H "Content-Type: application/json"
```
Confidence
96% confidence
Finding
The skill contains concrete curl commands that transmit data and a bearer token to an external HTTP endpoint, including a default URL on a private network. This is dangerous because it operationalizes outbound network access directly from the agent workflow, enabling exfiltration of user queries and backend interaction without any guardrails, destination validation, or minimization of transmitted data.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The document is written as normative workflow guidance and states the reference file defines the process, while presenting the instructions entirely in Chinese. This effectively imposes a language/locale choice on users or operators without offering an alternative language or documenting a justified region-specific constraint.

External Transmission

Medium
Category
Data Exfiltration
Content
当用户提出需要从知识库获取信息的问题时,必须遵循以下思维链:

### 1. 意图识别与初步定位
- **动作**: 调用 `curl -X POST "${RAGTOP_API_URL}/api/v1/ragtop/tool/list_kb" -H "Authorization: Bearer ${RAGTOP_API_TOKEN}"`。
- **目标**: 识别哪些知识库与用户问题相关。
- **策略**: 如果存在多个潜在相关的知识库,应根据其描述字段进行筛选。
Confidence
97% confidence
Finding
The skill directly prescribes external authenticated network calls via curl to a backend endpoint using a bearer token, which creates a clear external data transmission path. In this skill's context, that is more dangerous because the workflow is specifically designed to process arbitrary user research questions and may automatically forward sensitive enterprise topics, document filters, and rewritten queries to the service without any trust boundary warning or approval step.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The workflow instructs the agent to send user questions and derived queries to an external RAGTOP service using authenticated API calls, but it provides no user-facing disclosure, consent check, or data-handling warning. This can lead to unintended transmission of sensitive prompts, internal project names, or confidential documents to a remote backend, especially because the process encourages query rewriting and multi-query expansion that may reveal even more context than the original user input.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The instruction "严禁提及 `ragflow`,统一使用 `ragtop`" mandates a fixed terminology/output convention regardless of user preference. Under the policy rule, enforced language or locale constraints without user choice can be a natural-language policy violation.

Static analysis

No suspicious patterns detected.