Back to skill

Security audit

Knowledge Connector

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated local knowledge-workbench purpose, but exported HTML graphs load live third-party code while containing data derived from local notes.

Review before installing if you plan to import sensitive notes. Treat HTML visualization exports as not fully offline unless the remote vis-network dependency is bundled or pinned, and store KC_DATA_DIR somewhere protected because it keeps document-derived excerpts and paths. Use export/import/clear carefully, since those commands mutate the local knowledge store.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Warning
Location
src/index.js:805
Finding
Exported Visualization Executes Unpinned Remote JavaScript## Vulnerability Details **File Location**: `src/index.js:805` **Vulnerability Type**: Unpinned runtime dependency loaded from a third-party CDN **Risk Level**: Medium ### Vulnerable Code ```html <script src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script> ``` ### Technical Analysis The HTML generated by `kc visualize` loads and executes `vis-network` directly from `unpkg.com` without an exact version, Subresource Integrity hash, or restrictive Content Security Policy. The effective JavaScript payload can therefore change after the skill package has been reviewed. The generated page embeds graph nodes and edges in its JavaScript context. These values can contain information derived from imported local documents, including concept names, descriptions, and source excerpts. A malicious or compromised CDN response would execute in the same page context and could read that embedded information. This behavior also causes an external network request whenever the user opens the generated visualization, despite the application's otherwise local data-processing model. ### Attack Path 1. A user imports local notes or documents into Knowledge Connector. 2. The user runs `kc visualize --format html`, optionally writing the result to an HTML file. 3. The generated file contains the unversioned `unpkg.com` script reference and embeds the user's graph data. 4. The user opens the generated HTML file in a browser with network access. 5. The browser retrieves the current remote JavaScript payload from the CDN. 6. If the CDN, upstream package, publishing account, or delivery path has been compromised, attacker-controlled JavaScript executes in the visualization page. 7. The malicious script reads the embedded graph nodes and edges and may transmit them to an attacker-controlled endpoint. ### Impact Assessment Successful exploitation provides arbitrary JavaScript execution in the generated visualization's browser context. The attacker could ac ...[truncated 563 chars]
Remediation
## Remediation Suggestions 1. Bundle a reviewed version of `vis-network` with the package and reference the local asset so exported visualizations do not retrieve executable code at runtime. 2. If remote hosting is unavoidable, pin an exact dependency version using an immutable URL rather than a floating package path. 3. Add a verified Subresource Integrity hash and `crossorigin="anonymous"` to the script element. 4. Add a restrictive Content Security Policy that permits scripts only from explicitly trusted sources and limits outbound connections with `connect-src`. 5. Prefer generating a fully self-contained visualization so opening an export does not cause undeclared network traffic. 6. Document any unavoidable external requests and warn users before local document-derived data is placed in a page that executes third-party code. 7. Add a regression test asserting that generated HTML contains no unversioned external script references.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (17)

Ae1

High
Category
analysis-evasion
Content
If dependencies are missing but the files are present, `node bin/cli.js doctor` still works as a fallback diagnostic.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
A skill whose stated purpose is connecting local notes/documents and generating guidance does not obviously require a command to wipe all stored knowledge-base data. This is a destructive administrative capability unrelated to the user-facing connector outcomes described in the manifest.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill metadata explicitly promises a privacy boundary against external uploads unless the user chooses an external tool, but the generated visualization HTML always loads a third-party script from unpkg.com. Opening that HTML causes the client to contact an external domain and can leak usage metadata and potentially sensitive graph-derived content through the browser environment, violating the stated trust boundary.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This file contains user-facing natural-language content in Chinese for the short description, marketplace card copy, and install hook text. Because the file does not offer an opt-in choice of language or explain that the skill is intentionally region- or locale-specific, it appears to force a specific language on users.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill documents command execution behavior and references environment-dependent fallbacks such as `KC_DATA_DIR` and `node bin/cli.js doctor`, but it declares no explicit tool scope or permissions boundary. That mismatch can cause an agent runtime to invoke shell/environment capabilities implicitly, reducing reviewability and increasing the chance of unintended command execution or environment exposure.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The examples in the Search and Map/Visualize sections use Chinese prompts and concept names, which implies a preferred language/locale for interacting with the skill. The document does not state that multilingual input is supported or that Chinese is optional, so this can violate a language-choice policy by steering users toward a specific language without opt-in.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code defines the CLI's descriptions, status messages, warnings, and output almost entirely in Chinese, which imposes a specific language on all users. The file does not offer any language/locale selection or indicate that the tool is intentionally limited to a Chinese-speaking or region-specific audience.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a connector/workbench that imports notes/documents and produces guidance, maps, answers, and next actions, with an emphasis on handling local knowledge sources. This CLI also implements full administrative mutation operations for the internal knowledge base: exporting it, importing arbitrary database contents, and clearing all stored data, which goes beyond the described connector behavior.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The skill embeds Chinese-only known terms, stopwords, segmentation locale, status strings, and user-facing output, effectively forcing a Chinese-language interaction model. There is no indication that users can opt into another language or locale, which conflicts with the policy against enforcing a specific language without user choice.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The import flow reads local documents, extracts content-derived concepts and excerpts, and persists them to disk without any consent gate, warning, or sensitivity controls in the code path. In a skill whose description emphasizes privacy around sensitive notes, silently storing excerpts and metadata can surprise users and create local confidentiality risk if the workstation or data directory is later accessed by others.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
Answer generation, next-step guidance, error text, and HTML titles/content are emitted in Chinese regardless of user preference. This is a natural-language policy issue because the file provides no mechanism for language selection or documented rationale for a Chinese-only experience.

Context-Inappropriate Capability

Medium
Confidence
86% confidence
Finding
The manifest describes a connector for importing notes/documents and producing guidance, maps, answers, and next steps. Scanning PATH for executables and validating CLI packaging/runtime installation is an environment-diagnostic capability unrelated to knowledge connection itself.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The clear method irreversibly overwrites all persisted concepts, relations, and sources with empty arrays. There is no confirmation prompt, user-visible log, or inline documentation warning that all stored knowledge data will be deleted.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
This markdown file contains natural-language statements emphasizing Chinese query handling as a release goal, such as '中文问题能命中' and an example Chinese query. While supporting Chinese is not itself a problem, the wording can be read as privileging a specific language/locale without stating whether users can choose other languages or whether the scope is region-specific.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"author": "Pearl Agent",
  "license": "MIT",
  "dependencies": {
    "commander": "^11.0.0",
    "chalk": "^4.1.2",
    "ora": "^5.4.1"
  },
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"license": "MIT",
  "dependencies": {
    "commander": "^11.0.0",
    "chalk": "^4.1.2",
    "ora": "^5.4.1"
  },
  "engines": {
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dependencies": {
    "commander": "^11.0.0",
    "chalk": "^4.1.2",
    "ora": "^5.4.1"
  },
  "engines": {
    "node": ">=16.0.0"
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
test/test.js:269