Back to skill

Security audit

乐享知识库

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate Lexiang knowledge-base skill, but it needs Review because it handles local files, bearer tokens, MCP configuration, and raw uploads with insufficient containment.

Install only if you trust the Lexiang MCP endpoint and understand that this skill can read and upload user-selected local files, modify or delete knowledge-base content, and configure credentials. Prefer connector/OAuth setup or environment-backed secrets over plaintext tokens in mcp.json, review upload destinations before sending files, run folder sync with dry-run first, and avoid using the helper scripts with unpinned global dependencies.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/upload-files.py:127
Finding

Local File Disclosure Through an Unvalidated Upload URL

Content
View full analysis
bool: """Asynchronously upload a file to a pre-signed URL.""" if not HAS_AIOHTTP: # Execute the synchronous upload in a thread pool. loop = asyncio.get_event_loop() return await loop.run_in_executor( None, self.upload_file_sync, upload_url, file_path, mime_type ) # Read the complete local file. loop = asyncio.get_event_loop() data = await loop.run_in_executor(None, Path(file_path).read_bytes) async with aiohttp.ClientSession() as session: headers = {'Content-Type': mime_type} async with session.put(upload_url, data=data, headers=headers) as response: return response.status in (200, 201) def upload_file_sync(self, upload_url: str, file_path: str, mime_type: str) -> bool: """Synchronously upload a file to a pre-signed URL.""" with open(file_path, 'rb') as f: data = f.read() headers = {'Content-Type': mime_type} response = requests.put(upload_url, data=data, headers=headers) return response.status_code in (200, 201) ``` Related instructions in `references/files.md` and `references/blocks.md` similarly direct the agent to send local file contents to the URL returned by the MCP service: ```bash curl -X PUT \ -H "Content-Type: " \ --data-binary "@" \ "" ``` ### Technical Analysis The upload feature legitimately requires transmitting a user-selected file to a pre-signed object-storage URL. However, the implementation treats `upload_url` as fully trusted and performs no validation of: - The URL scheme, including whether HTTPS is required. - The des ...[truncated 2300 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/setup.md:72
Finding

Reusable Bearer Token Stored in Plaintext Configuration

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/README.md:5
Finding

Unpinned Third-Party Dependency Installation and Execution

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (60)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description presents a broad, full-function Lexiang knowledge-base skill covering many user-facing operations (search, write, edit, file, config, comments, drafts, smart tables, etc.). The supplied code chunk does not implement that general-purpose capability set. Instead, it is a narrowly scoped local-folder sync script: it reads local files, computes hashes, loads/saves a local state file, plans create/update actions, and generates MCP calls for folder creation and file upload/update. This includes undeclared local filesystem access and local persistence behavior. While the code is related to Lexiang knowledge-base file operations, its actual purpose is materially narrower and more specific than the declared 'full-featured' skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

There is a clear description-behavior mismatch. The description claims a comprehensive Lexiang knowledge base skill covering many user-facing knowledge base operations. The actual code chunk is only a unit test file focused on upload-related helper behavior in another script, including async gather semantics, nonblocking file reads, upload planning, and folder scanning. While upload/files are one small part of the declared domain, this chunk does not itself provide the declared full functionality and is primarily test infrastructure rather than the skill's operational logic.

Content

No source excerpt is available for this finding.

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

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

md
| 顶级域名(如 `lexiangla.com`) | `{domain}/pages/{entry_id}?company_from={company_from}` | `https://lexiangla.com/pages/abc?company_from=csig` |

**`{company_from}` 获取优先级:**
1. mcp.json `url` 字段中的 `company_from` 参数
2. 若无,使用 `whoami().company.code`

---

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · references/files.md (reported line 97)May include surrounding context.

md
| 顶级域名(如 `lexiangla.com`) | `{domain}/pages/{entry_id}?company_from={company_from}` | `https://lexiangla.com/pages/abc?company_from=csig` |

**`{company_from}` 获取优先级:**
1. mcp.json `url` 字段中的 `company_from` 参数
2. 若无,使用 `whoami().company.code`

---

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · references/setup.md (reported line 160)May include surrounding context.

md
| 顶级域名(如 `lexiangla.com`) | `{domain}/pages/{entry_id}?company_from={company_from}` | `https://lexiangla.com/pages/abc?company_from=csig` |

**`{company_from}` 获取优先级:**
1. mcp.json `url` 字段中的 `company_from` 参数
2. 若无,使用 `whoami().company.code`

---

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

The skill instructs the agent to read company_from from mcp.json URL parameters, which implies access to local MCP client configuration/state outside normal tool-mediated data flow. Exposing or depending on config-derived values can leak tenant-identifying information and encourages the model to inspect local configuration artifacts, expanding the trust boundary in a way that is unnecessary because whoami().company.code is already available as a safer source.

Content

Scanner excerpt · references/base.md (reported line 54)May include surrounding context.

md
1. 取 `whoami()` 返回的 `company.company_domain` 作为 `{domain}`
2. 判断 `{domain}` 是否为顶级域名(不含三级前缀,如 `lexiangla.com`):
   - **是**:使用 `{domain}/pages/{entry_id}?company_from={company_from}`
     - `{company_from}` 优先取 mcp.json `url` 中的 `company_from` 参数
     - 若无,取 `whoami()` 返回的 `company.code` ← **此时已调用过 whoami,直接取该值,不能省略**
   - **否**(如 `csig.lexiangla.com`):使用 `{domain}/pages/{entry_id}`,无需追加参数

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · references/setup.md (reported line 141)May include surrounding context.

当 MCP 返回正常结果但附带过期预警信息时:

  1. 先正常返回本次结果
  2. 读取 mcp.json 中 url 字段里的 company_from 参数值
  3. 在结果末尾附加提醒:
text

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · references/setup.md (reported line 152)May include surrounding context.

当 MCP 返回正常结果但附带过期预警信息时:

  1. 先正常返回本次结果
  2. 读取 mcp.json 中 url 字段里的 company_from 参数值
  3. 在结果末尾附加提醒:
text

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · references/setup.md (reported line 174)May include surrounding context.

md
| 问题 | 平台 | 解决方案 |
|------|------|---------|
| 连接器未连接 | 内置连接器平台 | 在客户端「集成」页面重新授权 |
| 连接无响应 | 其他平台 | 确认 mcp.json 中 URL 包含 `company_from` 且格式正确 |
| 401 未授权 | 其他平台 | token 过期或租户不匹配,参见上方「AccessToken 生命周期管理」 |
| 参数报错 | 所有平台 | 执行 `get_tool_schema(tool_name="xxx")` 获取最新参数定义 |
| 手动 MCP 与连接器冲突 | 内置连接器平台 | 从 mcp.json 删除 lexiang 手动条目,仅保留连接器 |

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

The skill instructs the agent to read a value from mcp.json to construct user-facing links. Accessing MCP configuration from skill logic can expose internal configuration details and creates a path for sensitive metadata leakage into responses, especially if configuration contains tokens, internal endpoints, or tenant-routing parameters beyond what is strictly needed.

Content

Scanner excerpt · references/writer.md (reported line 102)May include surrounding context.

md
1. `{domain}` = `whoami()` 返回的 `company.company_domain`
2. 判断 `{domain}` 是否为顶级域名(不含三级前缀,如 `lexiangla.com`):
   - **是**:追加 `?company_from={company_from}`
     - `{company_from}` 优先取 mcp.json `url` 中的 `company_from` 参数
     - 若 mcp.json 中无此参数,取 `whoami()` 返回的 `company.code`
   - **否**(如 `csig.lexiangla.com`):直接使用 `{domain}/pages/{entry_id}`,不追加参数
3. 最终链接:`{domain}/pages/{entry_id}` 或 `{domain}/pages/{entry_id}?company_from=xxx`

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The statement requires all external releases to use the fixed Chinese branding form 「注册老炮@MedXpert」 and forbids alternative naming forms. This imposes a specific language/locale presentation policy without offering user choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
77% confidence
Finding

The skill advertises broad operational capability over MCP and appears to rely on network/MCP/file-related behaviors, but it does not declare any explicit tool scope such as permissions or allowed-tools. In a least-privilege system, missing scope declarations make it harder to constrain runtime behavior and increase the risk of unintended tool access if the host grants defaults more broadly than intended.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions include very generic terms such as '知识库', '个人知识库', and '我的知识库', which can match many unrelated user requests. Over-broad invocation can cause the agent to activate this skill unexpectedly and route user data or actions into Lexiang-oriented workflows the user did not intend.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The invocation guidance uses broad phrases and pattern-based routing without clear exclusion boundaries, which can lead to ambiguous activation across unrelated contexts. In practice, this increases the chance of unintended reads, searches, or write-oriented follow-up behavior in the wrong system.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

文件以中文作为唯一说明语言呈现,并将其作为所有功能模块的共享基础层参考,但未说明这是面向特定中文用户群体的限定文档,也未提供其他语言选项。对于通用基础技能文档,这可能构成未经用户选择的语言/locale 约束。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file documents a delete_text operation that removes content from a document, but it does not warn users that the action may irreversibly alter or delete existing data. Under the markdown-specific missing-warning rule, destructive behaviors affecting user data should be explicitly disclosed.

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 · references/blocks.md (reported line 88)May include surrounding context.

md
Step 1: block_apply_block_attachment_upload
  → 返回 session_id + upload_url

Step 2: curl -X PUT --data-binary "@文件" upload_url
  (HTTP PUT,非 MCP 调用)

Step 3: 在 block_create_block_descendant 中,attachment/image block

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file appears to force a specific language/locale for all users by presenting all instructions, headings, and examples exclusively in Chinese. The policy requires flagging language or locale constraints unless the skill offers user opt-in or clearly documents a justified region-specific limitation, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

A natural-language policy concern exists when a skill effectively forces a specific language without user opt-in. This file is entirely Chinese-language and does not indicate that users may choose another language or that the locale restriction is intentional and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document template and instructions are entirely written as prescriptive Chinese-language guidance, starting with the title and imperative instruction to write documents according to these outlines. There is no indication that language choice is optional or that the template is intended only for a China-specific or Chinese-only context, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This is a markdown file, so SQP-2 applies to missing user warnings in the skill description. While the document explains what delete and publish do, it lacks a clear user-facing warning to confirm that deleting a draft discards unpublished changes and publishing makes changes live, both of which can affect user data or system content integrity.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The skill explicitly instructs the agent to leave the MCP boundary and execute a raw curl HTTP PUT to an externally supplied pre-signed upload_url. This creates a risky external transmission path where data is sent outside the managed tool interface, reducing policy enforcement, auditability, and validation of destination/contents; if the URL is tampered with or the file path is sensitive, the agent could transmit local data to an attacker-controlled endpoint.

Content

Scanner excerpt · references/files.md (reported line 69)May include surrounding context.

Step 2: HTTP PUT 上传文件内容(curl命令,非 MCP)

⚠️ 这一步不是 MCP 调用,必须用 curl 命令执行 HTTP PUT 请求。

bash
curl -X PUT \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This document describes recursive scanning of a local directory, hashing files, tracking metadata, and uploading contents to a remote knowledge base, but it does not warn users that local files, filenames, directory structure, hashes, timestamps, and related metadata will leave the local system. That omission can lead to accidental exfiltration of sensitive documents or metadata, especially because the workflow is framed as a routine sync operation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
83% confidence
Finding

The documentation instructs users to run npx ts-node without pinning a specific package version, which can cause execution of whatever version resolves at runtime from the package registry or local environment. In a workflow that handles local folder contents and uploads them remotely, this increases supply-chain risk because a malicious or compromised package version could access sensitive local files before or during sync.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, including the title and all routing guidance. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.