Back to skill

Security audit

知识图谱工具(免费版)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a local knowledge-graph memory tool, but it proposes persistent agent instruction-file changes and automatic context injection without enough user control or scoping.

Review this skill carefully before installing. It should only be used if you are comfortable with it modifying agent instruction files and loading stored knowledge into future sessions. Require a dry run or diff before any AGENTS.md, CLAUDE.md, or GEMINI.md change, keep personal KG data out of version control, and avoid storing untrusted instructions or secrets in the graph.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:33
Finding

Persistent Agent Memory and Instruction-File Poisoning

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 33 and 93–148
Vulnerability Type: Persistent injection of knowledge-graph content into Agent context and control files
Risk Level: Medium

Vulnerable Code Snippet

The following is an English translation of the relevant statements in SKILL.md:

text
On each session start, generate a compact KGML summary and inject it into
the context, allowing the Agent to retain structured long-term memory.
text
On each session start, the Agent automatically reads `kg-summary.md` and
brings key entities and relationships into the context.
bash
node scripts/install.mjs --workspace /path/to/workspace --platform skill-platform
text
The installation script automatically detects the platform type
(skill-platform / claude / gemini), modifies `AGENTS.md`, `CLAUDE.md`, or
`GEMINI.md` as appropriate, and injects knowledge-graph instructions and
summaries.

Technical Analysis

The Skill describes an installation process that modifies persistent Agent control files and causes knowledge-graph summaries to be loaded automatically in subsequent sessions. The affected control files include AGENTS.md, CLAUDE.md, and GEMINI.md.

Knowledge-graph information may originate from user documents, conversations, or other externally supplied text. The documented workflow does not establish a trust boundary between stored knowledge and executable Agent instructions. It also does not specify schema enforcement, neutralization of instruction-like content, provenance validation, or separation of untrusted data from the Agent's instruction context.

An attacker could therefore supply content containing directive-like text that is incorporated into kg-summary.md. If that summary is subsequently injected into an Agent control file or automatically loaded as trusted context, the malicious content may persistently influence future Agent behavi ...[truncated 2046 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not automatically modify AGENTS.md, CLAUDE.md, GEMINI.md, or other persistent Agent instruction files.
  2. Require explicit user approval before modifying any control file, and display the exact proposed patch before applying it.
  3. Treat kg-summary.md and all knowledge-graph values as untrusted data rather than Agent instructions.
  4. Place retrieved graph content inside a clearly delimited data block with an explicit instruction that its contents must not be followed as commands.
  5. Enforce a strict schema for generated summaries and reject unexpected fields, role markers, tool-call syntax, control directives, and instruction-like content.
  6. Preserve source provenance for every entity and relationship so that content from untrusted sources can be excluded from automatic context loading.
  7. Encode or escape control tokens and other syntax that the target Agent platform may interpret as instructions.
  8. Separate persistent knowledge storage from persistent behavioral rules. Knowledge updates must never alter system or workspace policy.
  9. Apply size limits, allowlists, and review requirements before any generated summary is loaded into a new session.
  10. Provide an uninstall and rollback operation that removes injected instructions and restores the original control files.
  11. Include the referenced scripts in future audit packages so their path validation, file-write boundaries, sanitization, and rollback behavior can be independently reviewed.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill metadata and description present the tool as suitable for SQL/database operations and broader data-management tasks, while the body describes a local JSON-backed knowledge graph operated by shell scripts. This mismatch can cause an agent or user to invoke the skill in contexts it cannot safely satisfy, increasing the chance of improper command execution, bad assumptions about storage guarantees, or misuse in workflows expecting real database semantics.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L004 says '支持中文交互', and L026 highlights '中文交互' as a core capability, but the document does not present this as an optional preference or a justified region-specific limitation. This can violate language/locale policy if the skill implicitly forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger condition says to use the skill for broad tasks like data analysis, report generation, statistics, and visualization, which exceeds the stated capability of a local JSON knowledge graph. Overbroad invocation criteria can cause the agent to select this skill in inappropriate contexts, leading to unsafe exec usage, incorrect file modifications, or misleading outputs treated as authoritative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The install flow states it will automatically modify AGENTS.md, CLAUDE.md, or GEMINI.md to inject instructions and summaries, but this high-impact behavior is not prominently disclosed as a file-changing action requiring explicit consent. Silent or under-emphasized instruction-file modification can persistently alter agent behavior, create prompt-injection persistence, and spread unreviewed content into future sessions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation says no external upload or extra API key is needed, but elsewhere it states the skill depends on an LLM API and includes guidance for HTTPS/network behavior. Contradictory security claims can mislead users into exposing sensitive local knowledge under false assumptions about offline-only behavior and can cause agents to apply weaker safeguards than appropriate.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

L247-L249 instruct users not to print vault values and reference vault.enc.json and .vault-key, while L283 says the free version does not support a vault. Similarly, L336-L338 discuss API-key and HTTPS concerns despite the skill being presented elsewhere as a local Markdown/JSON tool. These comments/documentation sections overstate or contradict the advertised free-version behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.