T09 · Insecure Skill Coding Practices
- Location
scripts/rag_api.py:242- Finding
Unauthenticated RAG API exposes indexed document content on all network interfaces
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent local RAG skill, but it exposes indexed document snippets through an unauthenticated web API and has unsafe local file-handling paths.
Install only if you are comfortable running a local document search service. Bind it to 127.0.0.1, add authentication before any network exposure, index only non-sensitive trusted documents, do not load vector stores from untrusted sources, and avoid using --rebuild with any path you have not verified.
scripts/rag_api.py:242Unauthenticated RAG API exposes indexed document content on all network interfaces
scripts/hybrid_retriever.py:377Unsafe pickle deserialization permits arbitrary code execution from a crafted BM25 index
scripts/index_knowledge.py:330Unrestricted rebuild option recursively deletes an arbitrary user-selected directory
scripts/requirements.txt:4Open-ended dependency constraints make installations non-reproducible and increase supply-chain exposure
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
gh auth status
不建议把 Personal Access Token 写进 remote URL 或 shell history。优先使用 SSH、GitHub CLI 或系统 credential manager。
## ClawHub 发布
Undisclosed reliance on a local Ollama HTTP API and incomplete implementation of the promised hybrid retrieval/FastAPI/auto-query features is a real security concern because it hides an external communication path and runtime dependency from users. Hidden or misstated dependencies make consent, threat modeling, and containment harder, particularly in an agent setting with automatic requests.
Undisclosed reliance on a local Ollama HTTP API and incomplete implementation of the promised hybrid retrieval/FastAPI/auto-query features is a real security concern because it hides an external communication path and runtime dependency from users. Hidden or misstated dependencies make consent, threat modeling, and containment harder, particularly in an agent setting with automatic requests.
Undisclosed reliance on a local Ollama HTTP API and incomplete implementation of the promised hybrid retrieval/FastAPI/auto-query features is a real security concern because it hides an external communication path and runtime dependency from users. Hidden or misstated dependencies make consent, threat modeling, and containment harder, particularly in an agent setting with automatic requests.
Undisclosed reliance on a local Ollama HTTP API and incomplete implementation of the promised hybrid retrieval/FastAPI/auto-query features is a real security concern because it hides an external communication path and runtime dependency from users. Hidden or misstated dependencies make consent, threat modeling, and containment harder, particularly in an agent setting with automatic requests.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
uvicorn rag_api:app --host 0.0.0.0 --port 8000
curl -X POST http://localhost:8000/query
-H "Content-Type: application/json"
-d '{"query": "问题", "top_k": 5}'
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
uvicorn rag_api:app --host 0.0.0.0 --port 8000
curl -X POST http://localhost:8000/query
-H "Content-Type: application/json"
-d '{"query": "问题", "top_k": 5}'
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.
The README describes building a local document index and exposing a FastAPI query endpoint that returns answer snippets with sources, but it does not warn that indexed confidential files may be surfaced through API responses. Users may deploy the service or enable auto-query features without understanding that sensitive local content can be retrieved and disclosed through localhost services, logs, screenshots, or downstream agent responses.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
查询 API:
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{
"query": "香港专才计划的签证有效期是多久?",
The example trigger phrases are broad natural-language requests like '从知识库查一下公司年假规定' and '香港专才计划的签证有效期是多久?', which are indistinguishable from ordinary user questions. In an auto-query integration context, this can cause the skill to activate unexpectedly and send user prompts to the local RAG system without explicit intent, increasing the chance of unintended retrieval of sensitive local document content.
The skill clearly instructs use of shell commands, file operations, environment activation, and local HTTP networking, yet it declares no explicit tool scope or permissions boundaries. That omission weakens reviewability and can allow an agent runtime to invoke broader capabilities than users expect, especially because the skill also describes automatic query behavior.
The skill description and all documented triggers are presented exclusively in Chinese, indicating a fixed language experience rather than an opt-in language preference. Under the policy, locale or language constraints should either be optional for the user or clearly justified as region-specific.
The trigger condition 'any query about indexed documents' is too broad for an agent skill that can perform automatic retrieval and network requests. Overbroad triggering can cause unintended activation on sensitive prompts, leading to unnecessary data exposure to the local RAG service or surprising tool use without clear user intent.
The skill explicitly performs HTTP POST requests carrying user queries to a localhost API. Localhost transmission is less severe than remote exfiltration, but it still crosses a trust boundary into another process that may log requests, use different access controls, or forward content to additional components.
uvicorn rag_api:app --host 0.0.0.0 --port 8000
curl -X POST http://localhost:8000/query
-H "Content-Type: application/json"
-d '{"query": "问题", "top_k": 5}'
The documentation says users can ask directly in conversation and the system will automatically call the RAG API, but it does not define decision boundaries, opt-in, or suppression conditions. In an agent context, ambiguous auto-invocation materially increases the chance of accidental tool use and silent transmission of user content.
The skill describes automatically sending conversational queries to a local HTTP service but does not warn users that their prompt text will leave the chat context and be transmitted elsewhere. Even when the destination is localhost, this is still a separate service boundary with logging, retention, or downstream model-processing implications.
Running the API with nohup/background persistence is not inherently malicious, but it can leave a long-lived local service running beyond the user's awareness. Persistent background services increase the window for unintended access, stale configuration, exposed logs, or continued processing of later requests.
uvicorn rag_api:app --host 0.0.0.0 --port 8000
nohup uvicorn rag_api:app --host 0.0.0.0 --port 8000 > rag_api.log 2>&1 &
### 阶段 3:查询使用
The document title, warning, and description are entirely in Chinese, which constitutes a language constraint in the skill’s natural-language interface. There is no indication that the skill is region-specific or that users may choose another language, so this appears to violate the language/locale policy criterion.
The guide explicitly instructs operators to start Uvicorn with --host 0.0.0.0, which exposes the API on all network interfaces. In the context of a local RAG knowledge service with no mention of authentication, TLS, firewalling, or reverse-proxy restrictions, this can unintentionally make query and metadata endpoints reachable by other hosts on the network.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl http://localhost:8000/health
响应:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
response = requests.post(
"http://localhost:8000/query",
json={
"query": "香港专才计划的签证有效期是多久",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
response = requests.post(
"http://localhost:8000/query",
json={
"query": "香港专才计划的签证有效期是多久",
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
import requests
response = requests.post(
"http://localhost:8000/query",
json={
"query": "香港专才计划的签证有效期是多久",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fetch('http://localhost:8000/query', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({