Back to skill

Security audit

knowledge-distiller

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent knowledge-interview skill, but it automatically stores personal archives and does not clearly confine user-named archive files to the intended folder.

Install only if you are comfortable with the skill saving conversation-derived knowledge into persistent Markdown archives. Avoid sensitive personal, business, or confidential topics unless you know where the archives are stored and can review or delete them. Domain names should be treated as plain labels, not paths; reject names containing slashes, backslashes, `..`, drive prefixes, or other path syntax before allowing archive reads or writes.

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
SKILL.md:61
Finding

Unsanitized Domain Name Used in Archive File Paths

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:61, 68-69, 93; supporting behavior in domains/README.md:3-5, 9
Vulnerability Type: Path traversal through user-controlled file names
Risk Level: Medium

Vulnerable Code Snippets

From SKILL.md:

markdown
61:   - Update the "last updated date" at the top of `domains/{domain name}.md`
markdown
68: 1. **Ask for the domain proactively**: Ask the user which domain or topic they want to discuss.
69: 2. **Check the historical archive**: After the user responds, check whether `domains/{domain name}.md` exists:
markdown
93:    - **If it does not exist**: Create an archive for the domain based on `@reference/domain_template.md`.

Supporting file-creation behavior from domains/README.md:

markdown
3: This directory stores domain archive files automatically created and updated by Knowledge Distiller.
5: - Each domain corresponds to a `.md` file, and the file name is the domain name.
9: > This directory is initially empty. A corresponding domain archive is automatically generated after the first conversation.

Technical Analysis

The Skill asks the user for a domain name and directly incorporates that value into the path domains/{domain name}.md. It then instructs the Agent to check, create, read, and update that path. No requirement is provided to sanitize the domain name, reject path separators or traversal components, canonicalize the resulting path, or verify that the resolved path remains inside the intended domains/ directory.

Consequently, an input containing traversal sequences could resolve outside the archive directory. For example, a domain name such as ../../notes/private would produce the nominal path:

text
domains/../../notes/private.md

Depending on the Agent's filesystem permissions and path-handling implementation, this could target a file outside domains/.

Attack Path

  1. An attacker invokes the Skill and is asked to provide a do ...[truncated 1471 chars]
Remediation
View remediation

Remediation Suggestions

  1. Map display names to safe identifiers

    • Preserve the original domain name only as display text.
    • Generate a restricted slug for the file name.
    • Permit only a conservative character set, such as ASCII letters, digits, hyphens, and underscores.
  2. Reject dangerous path syntax

    • Reject .., /, \, null bytes, absolute paths, drive prefixes, URI-like prefixes, and encoded separator variants.
    • Enforce a reasonable maximum file-name length.
  3. Canonicalize and enforce containment

    • Resolve the candidate path against the canonical domains/ directory.
    • Verify that the resolved path is a descendant of domains/ before every existence check, read, creation, or update.
    • Abort the operation if containment validation fails.
  4. Avoid following symbolic links

    • Reject archive paths that resolve through symbolic links.
    • Use no-follow and exclusive-creation semantics where supported.
  5. Prevent accidental overwrites

    • Use atomic file creation and updates.
    • Do not replace an existing file unless it is a validated archive belonging to the selected domain.
    • Apply restrictive file permissions.
  6. Document the validation requirement

    • Add explicit instructions to SKILL.md stating that user-provided domain names must never be used directly as paths.
    • Update domains/README.md to clarify that filenames are sanitized identifiers rather than raw domain names.
  7. Add negative tests

    • Test inputs including ../x, ../../x, /tmp/x, C:\x, a/b, a\b, encoded traversal sequences, long names, and names resolving through symbolic links.
    • Verify that all resulting operations remain confined to the canonical domains/ directory.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad, common conversational phrases such as 'deep dive', 'interview me', 'clarify my thoughts', 'what did we discuss', and 'resume session'. These can cause unintended activation during normal user interactions, leading the agent to switch into this skill unexpectedly and potentially alter workflow, questioning behavior, or data handling without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill content is predominantly written to conduct the interaction in Chinese and provides fixed Chinese prompts and workflow steps without instructing the agent to preserve the user's language preference. This can override the user's chosen language or create a mismatched interaction style, degrading usability and increasing the chance of confusion during sensitive knowledge-capture sessions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation explicitly says the skill will automatically create and update persistent domain archive files at runtime, which introduces stateful storage and cross-session retention beyond transient knowledge extraction. This can create privacy, consent, and data minimization risks if users are not clearly informed what is stored, how long it persists, and how it can be reviewed or deleted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README is written entirely in Chinese and provides operational instructions only in that language. Under the stated policy, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file’s user-facing instructions and examples are entirely in Chinese, beginning with a directive to present the modes to the user. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, 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
93% confidence
Finding

This markdown template is entirely written in Chinese and provides no indication that language choice is optional or user-selected. Under the language/locale policy, a skill should not force a specific language unless the constraint is clearly documented and justified or the user is offered a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown template is primarily written in Chinese, but it hardcodes several English terms such as status values, 'from', and 'Resolved Archive'. That creates a language/locale constraint in the skill content without any user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.