T09 · Insecure Skill Coding Practices
- Location
scripts/index.py:90- Finding
Unrestricted embedding endpoint can receive sensitive text and bearer credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears purpose-built for semantic Markdown search, but it needs review because it can upload broad workspace notes and search queries to a configured embedding provider without strong scoping or privacy controls.
Install only if you are comfortable sending the selected Markdown files and each search query to the configured embedding provider. Use a trusted HTTPS or local endpoint, avoid broad workspace roots, do not index secrets or regulated data, and treat the SQLite database as sensitive because it stores plaintext snippets.
scripts/index.py:90Unrestricted embedding endpoint can receive sensitive text and bearer credentials
scripts/index.py:124Recursive indexing uploads all visible Markdown without sensitive-data controls
The documentation directs users to configure a remote API base URL, and the skill’s function inherently sends indexed Markdown content to that endpoint for embedding generation. In this context, the external transmission is expected functionality, but it is still security-relevant because the data may include sensitive workspace notes and the README does not foreground the exfiltration risk.
export EMBEDDING_API_KEY="your-api-key"
export EMBEDDING_API_BASE="https://api.openai.com/v1" # 任何 OpenAI 兼容端点
export EMBEDDING_MODEL="text-embedding-3-small" # 可选,这是默认值
The README explains how to configure and use an external Embedding API but does not explicitly warn that workspace Markdown contents and user search queries will be transmitted off-host to a third-party service. Because this skill is specifically designed to index potentially sensitive notes and memories, users may unknowingly exfiltrate confidential data during indexing and search.
The environment variable documentation reinforces use of an external embedding endpoint but does not pair it with a warning about what data leaves the system. Since this skill operates over workspace memory files, that omission can lead to unintentional disclosure of private or confidential content to third-party services.
| 环境变量 | 说明 |
|----------|------|
| `EMBEDDING_API_KEY` | API Key(必填) |
| `EMBEDDING_API_BASE` | API 地址(默认:`https://api.openai.com/v1`) |
| `EMBEDDING_MODEL` | 模型名(默认:`text-embedding-3-small`) |
| `MSS_DB` | SQLite 数据库路径 |
| `MSS_TOP_K` | 搜索返回数量 |
The skill documents capabilities that read workspace files, access environment variables for API credentials, and make outbound network requests, but it does not declare any explicit tool scope or permissions. This weakens least-privilege controls and can cause an agent or reviewer to underestimate the skill’s effective access, increasing the chance of unintended data exposure from local markdown content sent to the embedding service.
The skill is explicitly designed to send workspace markdown content, or chunks derived from it, to an external OpenAI-compatible embedding API. Even though this is core functionality rather than obviously malicious behavior, it creates a real data exfiltration channel for potentially sensitive notes, decisions, or memory files, and the risk is heightened because the endpoint is configurable to any compatible service.
export EMBEDDING_API_KEY="sk-xxx"
export EMBEDDING_API_BASE="https://api.openai.com/v1" # any OpenAI-compatible endpoint
export EMBEDDING_MODEL="text-embedding-3-small" # optional, this is the default
The hardcoded default base URL points to an external OpenAI-compatible service, making off-host data transmission the default behavior for indexed markdown content. While not malicious by itself, this increases the likelihood of unintentional data exfiltration because users may run the tool without realizing their workspace notes are being sent outside the environment.
# --- Config ---
DEFAULT_MODEL = "text-embedding-3-small"
DEFAULT_BASE_URL = "https://api.openai.com/v1"
DEFAULT_DB = os.path.join(os.path.dirname(__file__), "..", "memory_search.sqlite")
CHUNK_TARGET = 400 # target tokens (~chars * 0.75)
CHUNK_OVERLAP = 80
The script sends full markdown chunk contents to an external embedding API, which can disclose sensitive notes, credentials, incident details, or proprietary information stored in the workspace. In this skill’s context, semantic indexing is the intended behavior, but the code provides no explicit consent gate, no warning at transmission time, and no filtering to prevent accidental export of sensitive markdown content.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import urllib.error
DEFAULT_MODEL = "text-embedding-3-small"
DEFAULT_BASE_URL = "https://api.openai.com/v1"
DEFAULT_DB = os.path.join(os.path.dirname(__file__), "..", "memory_search.sqlite")
DEFAULT_TOP_K = 5
DEFAULT_MIN_SCORE = 0.3
The script sends the user's query text to an external embedding API, which creates a real data disclosure risk if users enter sensitive notes, secrets, or internal project details. In this skill's context, semantic search over workspace memory makes that more concerning because queries are likely to reference confidential local content, yet the tool provides no explicit warning or consent step before transmitting data off-host.
The page describes indexing markdown notes via an external embedding API but does not clearly warn users that note contents are transmitted off-device during indexing and query text may also be sent during search. In a memory/note-search skill, those files can contain credentials, personal data, internal discussions, or other sensitive workspace content, so missing disclosure increases the risk of unintended data exfiltration to a third party.
The skill instructions and operational documentation are presented entirely in Chinese, which imposes a language requirement on users without any opt-in or stated locale justification. The policy calls for flagging language or locale constraints unless the skill offers a choice or clearly documents why the locale restriction is necessary.
The script reads an API credential from the EMBEDDING_API_KEY environment variable to authenticate outbound requests. Accessing credentials is safety-relevant under this rule, and the file lacks any explanatory comment or user-facing warning beyond an error message when the key is absent.
The document declares lang="zh-CN", and the visible content is entirely in Chinese, which indicates a fixed language/locale. Under the policy, forcing a specific language without user choice or documented justification is a natural-language policy concern.
No suspicious patterns detected.