Back to skill

Security audit

X Knowledge Base

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned, but it handles X session credentials, sends bookmark-derived data to external services, and rewrites local notes with limited safeguards.

Review this before installing if your X bookmarks or Obsidian vault contain private or work-sensitive material. Use a dedicated low-privilege environment, avoid running as root, keep backups of the bookmark/vault directories, do not set MINIMAX_ENDPOINT to an untrusted host, and understand that Jina/MiniMax processing can expose URLs and article text outside your machine.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_bookmarks.sh:32
Finding

X Session Credentials Exposed Through Process Arguments

Content
View full analysis
&1 || true) ``` ### Technical Analysis The script passes `BIRD_AUTH_TOKEN` and `BIRD_CT0` directly to the `bird` CLI as command-line arguments. These values represent authentication material for the user's X account. Supplying the credentials to X is necessary for retrieving private bookmarks, but placing them in the process argument vector is not necessary and violates least-exposure principles. Depending on operating-system process isolation, `/proc` mount options, container configuration, and monitoring software, command-line arguments may be visible through facilities such as: ```bash ps aux ps -ef cat /proc//cmdline ``` The use of environment variables to initially obtain the secrets does not prevent this exposure because the values are subsequently copied into `bird`'s argument vector. ### Attack Path 1. The victim exports valid `BIRD_AUTH_TOKEN` and `BIRD_CT0` values. 2. The victim executes `scripts/fetch_bookmarks.sh`. 3. The script launches `bird` with both credentials embedded in its command line. 4. A malicious local user, compromised monitoring agent, or other process with access to process metadata observes the command line while `bird` is running. 5. The attacker extracts the credentials and reuses them to access X within the privileges and lifetime of the captured session. ### Impact Assessment Successful exploitation can disclose an authenticated X session. An attacker may gain access to private bookmark data and potentially other account operations permitted by the captured credentials. The exact scope depends on X's session controls and whether additional verification is required. This issue does not independently grant operating-system ...[truncated 94 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/fetch_bookmarks.sh:8
Finding

Predictable Temporary File Allows Symlink-Based File Truncation

Content
View full analysis
"$BOOKMARKS_TMP_FILE" ``` ```bash URL=$(echo "$line" | grep -oE "https://x.com/[a-zA-Z0-9_]+/status/[0-9]+" || true) if [[ -n "$URL" ]]; then echo "📌 發現書籤: $URL" echo "$URL" >> "$BOOKMARKS_TMP_FILE" fi ``` ### Technical Analysis The script uses the fixed, globally predictable path `/tmp/new_bookmarks.txt`. It truncates and later appends to that path without: - Securely creating a unique temporary file - Verifying ownership - Rejecting symbolic links - Restricting file permissions - Using a private temporary directory The shell redirections used by `: > "$BOOKMARKS_TMP_FILE"` and `>> "$BOOKMARKS_TMP_FILE"` follow symbolic links. An attacker with access to the shared temporary directory can create the expected path as a symlink before the victim runs the script. The initial truncation is the most severe operation because it destroys the existing contents of the symlink target immediately, even if bookmark retrieval later fails. ### Attack Path 1. A local attacker predicts that the script will use `/tmp/new_bookmarks.txt`. 2. Before the victim runs the script, the attacker creates a symlink: ```bash ln -s /path/to/victim-writable-file /tmp/new_bookmarks.txt ``` 3. The victim executes `scripts/fetch_bookmarks.sh`. 4. The statement `: > "$BOOKMARKS_TMP_FILE"` follows the symlink and truncates the target file. 5. If bookmark URLs are found, the script also appends those URLs to the target. 6. The target remains corrupted after the script exits. Exploitation requires the attacker to be able to prepare the temporary path and the victim process to have permission to write to the selected target. ### Impact Asse ...[truncated 588 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
tools/bookmark_enhancer.py:119
Finding

Untrusted Article Content Can Manipulate AI Output and Poison Persisted Notes

Content
View full analysis
/dev/null || echo "") if [ -n "$CONTENT" ]; then FILENAME=$(echo "$URL" | sed 's|https://x.com/||' | sed 's|/status/.*||' | sed 's|/|_|g') TIMESTAMP=$(date +%Y-%m-%d) FULL_PATH="${OUTPUT_DIR}/${TIMESTAMP}_${FILENAME}.md" if [ ! -f "$FULL_PATH" ]; then echo "$CONTENT" > "$FULL_PATH" echo "✅ 已存檔: $FULL_PATH" else echo "⏭️ 略過(已存在): $FULL_PATH" fi fi ``` The externally controlled content is then embedded directly into an instruction-bearing AI prompt: ```python def generate_ai_summary(bookmark): content = bookmark.get("content", "") title = bookmark.get("title", "(untitled)") truncated = content[:3000] prompt = f"""請為以下文章產生濃縮摘要,格式如下: ## 📌 一句話摘要 (一句話概括文章核心,20字以內) ## 🎯 三個重點 1. (重點一) 2. (重點二) 3. (重點三) ## 💡 應用場景 (這篇文章的實際應用場景,2-3個) --- 文章標題:{title} 文章內容: {truncated} --- 請用繁體中文回覆,格式要清晰。""" return call_minimax(prompt) ``` The model response is persisted without structural validation or sanitization: ```python def add_ai_summary(bookmark, summary): path = Path(bookmark["path"]) content = path.read_text(encoding="utf-8", errors="ignore") if "## 📌 一句話摘要" in content or "## 📝 AI 濃縮" in content: print(" ⏭️ 跳過(已有摘要)") return False summary_block = f"\n\n---\n\n## 📝 AI 濃縮\n\n{summary}\n" path.write_text(content + summary_block, encoding="utf-8") return True ``` ### Technical Analysis Text obtained from X through Jina is untrusted and may be controlled by the author of a bookmarked post. The implementation inserts up to 3,000 characters of this ...[truncated 2510 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tainted flow: 'MINIMAX_ENDPOINT' from os.getenv (line 16, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The code sends bookmark content and an API bearer token to a fully environment-controlled endpoint without validating that it is the expected MiniMax host. If an attacker or misconfiguration changes MINIMAX_ENDPOINT, sensitive bookmark contents and credentials can be exfiltrated to an arbitrary server.

Content

Scanner excerpt · tools/bookmark_enhancer.py (reported line 41)May include surrounding context.

python
}

    try:
        response = requests.post(MINIMAX_ENDPOINT, headers=headers, json=data, timeout=45)
        if response.status_code >= 400:
            print(f"❌ MiniMax API 錯誤 {response.status_code}: {response.text[:300]}")
            return None

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims autonomous collection, Obsidian knowledge-base generation, AI summarization, and cross-linking, but the finding indicates only local Markdown reading and simple rule-based tag processing. Such overstated functionality is risky in a personal-knowledge context because the skill handles potentially sensitive saved posts and local notes; misleading claims reduce a user's ability to judge privacy and integrity risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill claims autonomous collection, Obsidian knowledge-base generation, AI summarization, and cross-linking, but the finding indicates only local Markdown reading and simple rule-based tag processing. Such overstated functionality is risky in a personal-knowledge context because the skill handles potentially sensitive saved posts and local notes; misleading claims reduce a user's ability to judge privacy and integrity risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The skill claims autonomous collection, Obsidian knowledge-base generation, AI summarization, and cross-linking, but the finding indicates only local Markdown reading and simple rule-based tag processing. Such overstated functionality is risky in a personal-knowledge context because the skill handles potentially sensitive saved posts and local notes; misleading claims reduce a user's ability to judge privacy and integrity risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill claims autonomous collection, Obsidian knowledge-base generation, AI summarization, and cross-linking, but the finding indicates only local Markdown reading and simple rule-based tag processing. Such overstated functionality is risky in a personal-knowledge context because the skill handles potentially sensitive saved posts and local notes; misleading claims reduce a user's ability to judge privacy and integrity risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The README states that the skill will automatically fetch X bookmarks, store them locally, and optionally send content to third-party services for summarization and trend analysis, but it does not clearly warn users about the privacy implications, data writes, or possible outbound transmission of bookmark content. In a knowledge-base skill handling potentially sensitive saved content, lack of explicit disclosure and consent makes accidental data exposure more likely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
79% confidence
Finding

The README documents use of the MiniMax API for AI summarization, which implies bookmark-derived content or fetched article text may be transmitted to an external third party. In this context, bookmarks can contain sensitive research, personal interests, or confidential links, so undocumented or insufficiently bounded external transmission creates a real privacy and data-handling risk.

Content

Scanner excerpt · README.md (reported line 23)May include surrounding context.

md
2. **MiniMax API**(AI 濃縮,可選)
   - 需要 API key
   - endpoint: https://api.minimax.io/anthropic/v1/messages

3. **Brave Search API**(趨勢分析,可選)
   - 需要 API key

External Transmission

Medium
Category
Data Exfiltration
Confidence
76% confidence
Finding

The environment variable example hardcodes an external API endpoint for MiniMax, reinforcing that the skill is configured to communicate with a third-party service. While merely documenting an endpoint is not malicious, in the context of automatic bookmark ingestion and AI enrichment it signals a real outbound data flow that can expose user content if enabled without clear safeguards.

Content

Scanner excerpt · README.md (reported line 34)May include surrounding context.

export BIRD_AUTH_TOKEN="..." export BIRD_CT0="..." export MINIMAX_API_KEY="..." # 可不填;不填即跳過 AI 濃縮 export MINIMAX_ENDPOINT="https://api.minimax.io/anthropic/v1/messages" export MINIMAX_MODEL="MiniMax-M2.5"

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises capabilities that inherently require network, file, shell, and environment access, but it does not declare any explicit tool scope or permission boundaries. This creates an overbroad trust model where an agent may execute sensitive operations without clear user-visible constraints, increasing the risk of unintended data access, credential use, or filesystem modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes fetching bookmarks, full articles, and AI summarization but does not warn users that bookmark/article data may be sent to external services such as Jina AI or MiniMax. Because bookmarks can reveal interests, work topics, and private research, lack of disclosure undermines informed consent and creates a meaningful privacy exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrase for checking bookmarks is broad and could be invoked during ordinary conversation without clear confirmation or scope limits. In a skill that can access bookmarks, files, and networks, ambiguous activation raises the chance of accidental collection, processing, or storage of personal content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trend-report phrases are conversational and could overlap with normal user dialogue, causing unintended execution of trend analysis workflows. While lower impact than data exfiltration, accidental invocation can still process sensitive preference data and update persistent tracking files without deliberate consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

Referencing the MiniMax API endpoint indicates outbound transmission to a third-party service for summarization. External transmission is not inherently malicious, but in this context it becomes security-relevant because the content may include bookmarked posts and extracted article text, and the skill text does not sufficiently describe consent, minimization, retention, or redaction.

Content

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

text

### MiniMax API
- endpoint: https://api.minimax.io/anthropic/v1/messages
- model: MiniMax-M2.5

### 趨勢數據格式 (trends.json)

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

The environment variable configuration confirms support for a third-party MiniMax endpoint, reinforcing that the skill is designed for external data transmission. In a personal knowledge-base skill, this is risky because sensitive bookmark-derived content may leave the local environment, and the configuration does not pair this with a clear warning or safe defaults.

Content

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

md
- `BIRD_AUTH_TOKEN`(必填)
- `BIRD_CT0`(必填)
- `MINIMAX_API_KEY`(選填,不填則略過 AI 濃縮)
- `MINIMAX_ENDPOINT`(選填,預設 `https://api.minimax.io/anthropic/v1/messages`)
- `MINIMAX_MODEL`(選填,預設 `MiniMax-M2.5`)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This YAML file uses Chinese-only headings and labels such as "興趣標籤配置" and related section names, with no indication that language selection is optional or that the locale is intentionally constrained for a region-specific purpose. The stated policy flags natural-language locale constraints when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script transmits every bookmarked URL to the external service r.jina.ai, which can expose a user's reading habits, private or sensitive links, and associated metadata to a third party without any explicit notice or consent step. In a knowledge-base/bookmark-harvesting skill, this is more concerning because the data being processed is inherently user-specific and may include confidential research or internal resources.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · tools/bookmark_enhancer.py (reported line 16)May include surrounding context.

python
BOOKMARKS_DIR = Path(os.getenv("BOOKMARKS_DIR", "/home/ubuntu/clawd/memory/bookmarks"))
MINIMAX_API_KEY = os.getenv("MINIMAX_API_KEY", "")
MINIMAX_ENDPOINT = os.getenv("MINIMAX_ENDPOINT", "https://api.minimax.io/anthropic/v1/messages")
MINIMAX_MODEL = os.getenv("MINIMAX_MODEL", "MiniMax-M2.5")

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This code explicitly sends data to an external network service. External transmission is expected for AI summarization, but because bookmark contents are user data and no trust boundary/consent controls are enforced here, it represents a real confidentiality risk in this skill context.

Content

Scanner excerpt · tools/bookmark_enhancer.py (reported line 41)May include surrounding context.

python
}

    try:
        response = requests.post(MINIMAX_ENDPOINT, headers=headers, json=data, timeout=45)
        if response.status_code >= 400:
            print(f"❌ MiniMax API 錯誤 {response.status_code}: {response.text[:300]}")
            return None

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script transmits bookmark title and up to 3000 characters of bookmark content to an external AI service, but there is no explicit warning, consent prompt, or data-classification check before disclosure. In a knowledge-base/bookmark tool, stored bookmarks may contain private notes, URLs, or sensitive research, so silent external transmission materially increases privacy and confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The function rewrites user bookmark files in place by appending AI-generated summaries without confirmation, backup, or transactional safety. This can cause silent data integrity issues, especially if the model output is poor, malformed, or if repeated runs modify a user's curated notes unexpectedly.

Content

No source excerpt is available for this finding.

Tainted flow: 'content' from pathlib.Path.read_text (line 155, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · tools/bookmark_enhancer.py (reported line 162)May include surrounding context.

python
return False

    summary_block = f"\n\n---\n\n## 📝 AI 濃縮\n\n{summary}\n"
    path.write_text(content + summary_block, encoding="utf-8")
    return True

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Cross-link generation automatically rewrites bookmark files by appending related-link sections, again without advance warning or approval. In the context of a personal knowledge base, silent bulk edits can degrade note quality, pollute content, or break downstream tooling that expects stable markdown files.

Content

No source excerpt is available for this finding.

Tainted flow: 'content' from pathlib.Path.read_text (line 174, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · tools/bookmark_enhancer.py (reported line 182)May include surrounding context.

python
for r in related:
            links_block += f"- [[{r['filename']}|{r['title']}]] ({', '.join(r['tags'])})\n"

        path.write_text(content + links_block, encoding="utf-8")
        updated += 1

    return updated

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script recursively reads all bookmark markdown files and extracts tags, which can reveal a user's interests and behavior patterns. In this skill's context, bookmarks are personal data, and processing them into an inferred profile without an explicit notice, consent flow, or minimization controls creates a privacy vulnerability through silent profiling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code persists inferred trends, emerging topics, and recommended keywords to a JSON file, creating a durable interest profile on disk. Persistent storage increases privacy risk because the derived profile may be more sensitive than raw bookmarks and could be accessed later by other tools, users, or processes without the user's awareness.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.