Back to skill

Security audit

LinkMind Capture

Security checks for vulnerabilities and agentic risk

Overview

The skill broadly matches its stated link-capture purpose, but it handles cookies, browser automation, media uploads, and remote downloads with weak scoping that could expose credentials or local data.

Review before installing. Avoid configuring platform cookies or API keys until the WeChat hostname validation, image-download restrictions, ASR endpoint validation, and .env permissions are fixed. If you do use it, run it in a limited environment, check links before capture, and use scoped or disposable credentials.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wechat.ts:22
Finding

WeChat session cookie disclosure through weak hostname validation

Content
View full analysis
{ const headers: Record = { "User-Agent": DESKTOP_UA, Accept: "text/html,application/xhtml+xml", "Accept-Language": "zh-CN,zh;q=0.9", }; if (cookie) headers["Cookie"] = cookie; let resp: Response; try { resp = await withRetry( () => fetch(url, { headers, redirect: "follow" }), { shouldRetry: isRetryableError }, ); } catch { return null; } ``` ### Technical Analysis The handler verifies the hostname using substring matching rather than exact origin matching. Consequently, an attacker-controlled hostname such as: ```text mp.weixin.qq.com.attacker.example ``` passes validation because it contains the string `mp.weixin.qq.com`. If the user has configured `LINKMIND_WXMP_COOKIE`, the handler places the complete cookie value in the `Cookie` request header. The initial request is then sent to the attacker-controlled host. The accepted URL must also have a valid article path, but an attacker can trivially use a path such as `/s/id`. The use of `redirect: "follow"` also creates an additional origin-control concern. Authentication data must never be forwarded to a destination unless every request destination is verified as an approved WeChat origin. ### Attack Path 1. The user configures a WeChat cookie to access restricted content or retrieve article statistics. 2. An attacker supplies a URL such as: ```text https://mp.weixin.qq.com.attacker.example/s/articl ...[truncated 956 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/download-images.ts:57
Finding

Server-side request forgery through unrestricted content image downloads

Content
View full analysis
]*>/gi; let m: RegExpExecArray | null; while ((m = imgRe.exec(html)) !== null) { const tag = m[0]; const dataSrc = tag.match(/data-src="([^"]+)"/)?.[1]; const src = tag.match(/\bsrc="([^"]+)"/)?.[1]; let url: string | null = null; if (dataSrc && dataSrc.startsWith("http")) { url = dataSrc; } else if (src && src.startsWith("http")) { url = src; } if (url && !WECHAT_UI_DOMAINS.some((d) => url!.includes(d))) { results.push(url); } } return results; } ``` The downloader performs unrestricted requests to those URLs: ```ts const resp = await fetch(url, { headers, signal: controller.signal, }); if (!resp.ok) { const err = new Error(`HTTP ${resp.status}`); (err as any).httpStatus = resp.status; throw err; } const ct = resp.headers.get("content-type"); const ext = guessExtension(url, ct); const arrayBuf = await resp.arrayBuffer(); return { data: Buffer.from(arrayBuf), ext }; ``` ### Technical Analysis The downloader does not validate: - The destination hostname - The resolved IP address - Whether the destination is loopback, private, link-local, or a cloud metadata address - Redirect destinations - Whether the response is actually an image - The maximum response size An article under an attacker's control can therefore provide an image URL that points to an internal service. The workflow in `SKILL.md` directs the Agent to pass extracted image URLs to this downloader and then read successfully downloaded file ...[truncated 1559 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/config.ts:109
Finding

Configurable ASR endpoint can receive the OpenAI API key and captured audio

Content
View full analysis
{ const fileBuffer = readFileSync(mp3Path); const form = new FormData(); form.append("model", model); form.append("response_format", "srt"); form.append( "file", new Blob([fileBuffer], { type: "audio/mp3" }), "audio.mp3", ); const resp = await fetch(`${baseUrl}/audio/transcriptions`, { method: "POST", headers: { Authorization: `Bearer ${apiKey}` }, body: form, }); ``` ### Technical Analysis `LINKMIND_OPENAI_BASE_URL` or `config.asr.openai.base_url` controls the destination of a request carrying both: - The OpenAI-compatible bearer API key - The complete downloaded audio file or selected audio segment No validation requires HTTPS, an approved hostname, or informed confirmation of a custom provider. An untrusted or mistakenly modified configuration can therefore redirect sensitive credentials and captured media to an arbitrary server. Custom OpenAI-compatible providers can be a legitimate feature, but sending an existing OpenAI credential to a custom destination by default is unsafe. Endpoint selection and credential selection must be bound together so that credentials intended for one provider cannot be silently sent to an ...[truncated 1061 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup.ts:256
Finding

Sensitive credential file is created without explicit restrictive permissions

Content
View full analysis
0) { writeFileSync(ENV_PATH, envLines.join("\n") + "\n"); p.log.success(`已写入 .env(${envLines.length} 项凭据)`); } ``` ### Technical Analysis The `.env` file can contain: - Weibo session cookies - Xiaohongshu session cookies - WeChat session cookies - iFlytek credentials - An OpenAI API key The file is written without an explicit mode. Its resulting permissions therefore depend on the host's process umask and any existing file permissions. In a permissively configured environment, other local users or processes may be able to read the credentials. If the file already exists with weak permissions, overwriting it does not reliably harden those permissions. ### Attack Path 1. The user runs the setup wizard and enters platform cookies or ASR credentials. 2. The setup script serializes those secrets into `.env`. 3. The file is created or overwritten without enforcing owner-only access. 4. Another local user, compromised process, backup service, or overly broad workspace integration reads the file. 5. The exposed cookies or API credentials are reused outside the Skill. ### Impact Assessment A local attacker may obtain authenticated social-platform sessions or paid API credentials. The resulting scope depends on the individual credential and may include account impersonation, access to restricted content, unauthorized API usage, and financial charges. The issue does not itself grant remote access, but it weakens the local confidentiality boundary around high-value secrets. ]]>
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/package-lock.json:21
Finding

Dependency lockfile retrieves packages from a non-official registry mirror

Content
View full analysis
" --config skills/linkmind/config.json ``` ### Technical Analysis The project relies on package archives hosted by `registry.npmmirror.com` instead of the official npm registry. Package integrity hashes reduce accidental tampering risk, but installation still depends on the availability, governance, and faithful synchronization of an additional distribution service. The repeated use of `npx tsx` also creates ambiguity about whether the local locked executable or a remotely obtained package will run, particularly when dependencies have not already been installed. No evidence was found that the named dependencies are themselves malicious. The finding concerns the unsafe package acquisition channel and execution workflow. ### Attack Path 1. A user installs dependencies or invokes an `npx` command in an environment where the local package is unavailable. 2. Package metadata or archives are obtained through the configured non-official distribution path. 3. If the mirror, DNS route, registry configuration, or an upstream package is compromised, altered package code may be installed. 4. TypeScript tooling or another dependency executes during normal Skill setup or use. 5. Compromised package code inherits the Skill process's access to configuration files, cookies, API keys, the Obsidian vault, and network connectivity. ### Impact Assessment A successful dependency compromise could execute arbitrary code with the cur ...[truncated 294 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (90)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Controlling a local Chrome instance via CDP, injecting cookies, and using stealth/anti-detection behavior is materially more dangerous than simple link capture. If the implementation does this, it enables broad authenticated session access and arbitrary page interaction under the user's browser context, which is a significant hidden-automation risk.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The skill explicitly checks for ASR credentials in .env and instructs the workflow to use them during automated subprocess execution. Accessing local secret material from an agent skill is dangerous because those credentials may be exposed to helper scripts, logs, error messages, or compromised dependencies, especially alongside unpinned npx execution.

Content

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

md
- `.env` 中已配置 ASR 服务(讯飞或 OpenAI)

若条件不满足(ASR 未配置),跳过此步骤,在 Step 3 中提示:
"⚠️ 平台字幕不可用,ASR 服务未配置,无法转写音频。请在 .env 中配置 ASR 凭据。"

**执行步骤:**

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

This step again relies on reading .env to determine and use ASR secrets for video transcription. In the context of a shell-capable skill with runtime dependency resolution and external media processing, secret access materially increases the blast radius of any compromise or logging mistake.

Content

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

md
**Skip conditions (do NOT run the script):**
- `videoUrl` is `null` → no video to transcribe
- `.env` has no ASR variables configured → ASR not configured;
  inform the user: "视频转写需要配置 ASR 服务(科大讯飞或 OpenAI Whisper),请在 .env 中配置。参考 .env.example。"

**Multilingual transcripts:** If `fullText` is in a non-Chinese language, translate
and present the key points in Chinese when writing the deep summary. The SRT file

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

This file opens local TCP connections and fetches a DevTools endpoint over HTTP/WebSocket, which is network capability beyond simple markdown generation. If network access is not declared, the skill can communicate over local services without user awareness, and CDP access is especially sensitive because it enables broad browser control.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

This file opens local TCP connections and fetches a DevTools endpoint over HTTP/WebSocket, which is network capability beyond simple markdown generation. If network access is not declared, the skill can communicate over local services without user awareness, and CDP access is especially sensitive because it enables broad browser control.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.ts (reported line 33)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.ts (reported line 60)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.ts (reported line 62)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.ts (reported line 63)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/extract-transcript.ts (reported line 439)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/wechat.ts (reported line 499)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/weibo.ts (reported line 310)May include surrounding context.

ts
}

// ---------------------------------------------------------------------------
// .env loader (minimal, no external dependency)
// ---------------------------------------------------------------------------

function loadEnvFile(path: string): void {

Static analysis

Detected: suspicious.dangerous_exec, suspicious.dynamic_code_execution, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/chrome-cdp.ts:206

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/extract-transcript.ts:115

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/test-transcript.ts:205

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/test-wechat.ts:365

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/test-weibo.ts:228

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/test-xiaohongshu.ts:259

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/test-xiaoyuzhou.ts:160

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/wechat.ts:358

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/chrome-cdp.ts:27