Back to skill

Security audit

Personal Ontology

Security checks for vulnerabilities and agentic risk

Overview

The skill is not malicious, but it asks an agent to repeatedly scan and summarize highly personal notes, tasks, journals, and calendar context with limited scoping controls.

Install only if you are comfortable granting the agent access to the specific notes, journals, tasks, and calendar sources you choose. Before enabling daily or automated use, restrict it to selected folders, exclude sensitive notes, review suggestions before writes, avoid saving verbatim private quotes unless needed, and treat generated Mermaid/SVG output as untrusted if it includes imported or shared note content.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/render-ontology.js:40
Finding
Unescaped Ontology Names Allow Mermaid Diagram Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/render-ontology.js:40-45, 102-104` **Vulnerability Type**: Mermaid syntax injection caused by unescaped user-controlled labels **Risk Level**: Medium ### Vulnerable Code ```js // Extract objects (## headers with IDs) const objectRegex = /^## ([A-Z0-9]+) — (.+)$/gm; let match; while ((match = objectRegex.exec(content)) !== null) { objects.push({ id: match[1], name: match[2].substring(0, 30) + (match[2].length > 30 ? '...' : ''), type: type }); } ``` ```js // Add nodes for (const obj of objects) { const shape = obj.type === 'core-self' ? `((${obj.name}))` : `[${obj.name}]`; lines.push(` ${obj.id}${shape}`); } ``` ### Technical Analysis The renderer reads object names from ontology Markdown headings and directly interpolates those names into Mermaid source code. Although names are truncated to 30 characters, truncation does not escape Mermaid metacharacters such as `]`, `)`, `"`, `;`, or comment markers. An object name can therefore terminate its intended node label and append another Mermaid statement. For example, a crafted heading could contain a short payload resembling: ```markdown ## B1 — X];click B1 "https://x";%% ``` The generated Mermaid source would contain attacker-influenced graph syntax rather than treating the entire value as plain label text. The actual behavior of injected directives depends on the Mermaid implementation and its security configuration. Strict renderers may disable active links or scripts, but injected graph nodes, edges, styling, or links can still compromise the integrity of the visualization. A permissive downstream renderer may expose a greater risk. The affected data normally comes from local ontology files, and the documented bootstrap process requires user confirmation before committing extracted objects. This reduces exploitability but does not provide syntactic validation: imported content, manually edited ontology files, or inco ...[truncated 1564 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat object IDs and labels as separate data types: - Continue enforcing a strict identifier allowlist such as `^[A-Z][A-Z0-9]*$`. - Encode labels before inserting them into Mermaid syntax. 2. Escape or reject all Mermaid control characters in labels, including: - Square and round brackets. - Quotes and backticks. - Semicolons. - Newline and carriage-return characters. - Mermaid comment markers and directive syntax. 3. Prefer JSON-style quoted Mermaid labels with explicit escaping. For example: ```js function escapeMermaidLabel(value) { return String(value) .replace(/[\r\n]/g, ' ') .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/[\[\]();`]/g, ''); } for (const obj of objects) { const label = escapeMermaidLabel(obj.name); const shape = obj.type === 'core-self' ? `(("${label}"))` : `["${label}"]`; lines.push(` ${obj.id}${shape}`); } ``` 4. Validate names before rendering and fail closed when a label contains unsupported control syntax rather than silently rendering it. 5. Configure every downstream Mermaid renderer with its strictest available security mode. Disable JavaScript URLs, click callbacks, external resource loading, and unsafe SVG content. 6. If generated SVG files are displayed in a browser or web application, sanitize them with a maintained SVG sanitizer and serve them with a restrictive Content Security Policy. 7. Add regression tests for labels containing `]`, `)`, `"`, `;`, `%%`, `click`, Mermaid initialization directives, and embedded line breaks. Tests should verify that these values remain inert text and cannot create additional graph statements. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md` - This file (agent instructions)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Self-Modification

High
Category
Rogue Agent
Content
**Examples:**
- ✅ Goal: "Build distribution via Moltbot ecosystem"
- ✅ Project: "Ship personal-ontology skill" (serves the Goal)
- ✅ Task: "Write SKILL.md" (part of the Project)

**Edge cases:**
- "Launch newsletter" — Goal if it's the outcome you want; Project if it serves a larger Goal (like "Build audience")
Confidence
85% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill defines behavior that reads environment-adjacent state and performs file operations, but it does not declare any explicit tool scope or permissions boundary. This creates ambiguity about what resources the agent may access and weakens least-privilege controls, increasing the chance of overbroad access during execution.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill instructs the agent to scan notes, maintain ontology files, and run light daily scans, but it does not clearly warn the user that this is persistent monitoring and ongoing modification of personal data. Users may not understand that sensitive content will be repeatedly processed and that files may be changed over time, creating privacy and integrity risks.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
Embedded and automated modes explicitly describe background use of the user's ontology and related personal data to influence decisions without explicit reference each time. In a skill centered on highly sensitive identity, belief, goal, calendar, and task data, silent background processing materially increases privacy risk and can affect user decisions without informed awareness.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The daily passive scan section directs the agent to inspect recent notes, modified files, completed tasks, and calendar or journal entries, all of which are likely to contain sensitive personal information. Without a clear safety warning, consent flow, and source limitations, the skill encourages broad surveillance-style collection and inference over intimate user data.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill directs an agent to scan a user's notes vault, which can contain highly sensitive personal data, but it does not require a clear user-facing disclosure of privacy risks, scope, or data handling before access. Even with a stated prerequisite of user consent, the lack of explicit warning and minimization guidance increases the chance of over-collection and unexpected exposure of intimate content.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to write extracted quotes and structured summaries from private notes into a new suggestions file, effectively duplicating sensitive personal content into another location. This increases the attack surface, retention footprint, and chance of accidental disclosure, especially because users may not realize exact text from journals or self-descriptions is being copied verbatim.

Ssd 3

Medium
Confidence
94% confidence
Finding
Copying exact user note content, including beliefs, goals, values, and other self-descriptions, into a compiled output file can expose sensitive psychological, spiritual, or identity-related information beyond its original context. Because the content is normalized and centralized, it may become easier to search, share, sync, or exfiltrate than the original scattered notes.

Ssd 3

Medium
Confidence
83% confidence
Finding
The review flow instructs the agent to restate statements, predictions, and other extracted items found in the user's notes, along with their sources. Although framed as review, this is still a natural-language instruction to surface consolidated private content from prior inputs and files, increasing risk of overexposing sensitive material during interaction.

Static analysis

No suspicious patterns detected.