Back to skill

Security audit

Duru Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local Markdown memory skill, but it needs review because some helpers can write outside the memory folder and can send persistent memory content to a configurable HTTP endpoint.

Install only if you are comfortable with a skill that maintains durable local agent memory. Before use, restrict helpers to `memory/`, keep Ollama on loopback unless you explicitly trust a remote endpoint, review or back up memory files before compaction/forgetting, and pin dependencies with a lockfile.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory-write-tag.sh:17
Finding

Arbitrary File Write Through Unrestricted Target Path

Content
View full analysis
"$ABS_TARGET" else cat "$CONTENT_FILE" >> "$ABS_TARGET" fi ``` ### Technical Analysis The script is presented as a helper for writing Markdown memory, but it does not constrain the target to the workspace's `memory` directory. It accepts: - Absolute target paths. - Relative paths containing traversal sequences such as `../../`. - Targets that resolve through symbolic links. - Files without a `.md` extension. - Any mode other than `write`, which silently falls into append behavior. Shell quoting prevents direct shell metacharacter injection, but it does not prevent path traversal or unrestricted filesystem modification. The write occurs with the privileges of the user running the Skill. The subsequent tagger does not mitigate the issue. The dangerous write is completed before tagging begins, and the tagger only processes existing `.md` files. ### Attack Path 1. An attacker supplies content or instructions that influence the arguments passed to `memory-write-tag.sh`. 2. The attacker chooses an absolute path or a traversal path, for example: `../../.config/example/config.yaml`. 3. The attacker supplies a controlled content file and selects `write` or append behavior. 4. The script resolves the path without checking whether it remains under `$WORKSPACE/memory`. 5. `cat` overwrites or appends attacker-controlled content to the selected file. 6. If the affected file is later loaded or executed by another application, the modification can produce additional effects under that application's privileges. ### Impact Assessment An attacker can m ...[truncated 484 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory-auto-tag.py:98
Finding

Configurable Model Endpoint Can Exfiltrate Persistent Memory

Content
View full analysis
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
scripts/memory-compact.py:44
Finding

Untrusted Log Content Can Poison Model-Generated Persistent Memory

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
pyproject.toml:6
Finding

Unpinned Dependencies and Native Extension Create Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (23)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. Use `scripts/memory-search.sh "<query>"` when you want explicit file-level control, debugging, maintenance, or a second opinion against built-in recall.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. Use `scripts/memory-search.sh "<query>"` when you want explicit file-level control, debugging, maintenance, or a second opinion against built-in recall.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `scripts/memory-auto-tag.py`: local-model auto-tagger (model from `config.yaml`, default `gemma4:e4b`) for incremental memory changes (`--mode tag|review`, `-

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents a retention lifecycle including 'monthly archive/forget', which implies data movement or deletion affecting user memory content. While the README mentions auditability and review preferences later, it does not give a direct user-facing warning near the feature description that entries may be archived or forgotten, which is relevant to user data integrity.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill references capabilities that can read and write local files, invoke shell scripts, access environment data, and potentially use networked local services, yet it does not declare any explicit tool scope or permission boundaries. This creates ambiguity about what the agent may do when the skill is activated, increasing the risk of unintended file modification, command execution, or data exposure during routine memory operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description is broad enough to match many common tasks involving notes, logs, memory, or continuity, which can cause the skill to activate in situations beyond the user's intent. Because the skill includes persistence and maintenance behaviors, overbroad activation can lead to unplanned memory reads or writes and unnecessary execution of helper scripts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to update persistent local memory files and changelogs as part of normal workflow without requiring an explicit warning or user confirmation that local data will be modified. In practice, this can cause silent persistence of information, accidental overwrites, or creation of durable records the user did not expect.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The memory admission rules explicitly encourage persistent storage of decisions, commitments, deadlines, preferences, and blockers, all of which may include sensitive personal or project information. Persistently logging this data in shared Markdown memory increases privacy and confidentiality risk, especially when combined with indexing, retrieval, and long retention across sessions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script transmits markdown memory contents to an HTTP API endpoint, even if the default is localhost. Because the base URL is configurable, sensitive memory notes can be sent to a non-local service without strong safeguards, which expands the trust boundary beyond a purely local memory workflow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The --files option accepts arbitrary markdown paths and resolves them relative to the workspace, but does not enforce that they remain under the memory directory. This allows the tool to rewrite unrelated markdown files outside its stated scope, creating integrity and accidental-overwrite risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code sends markdown body content to the tagging model without an explicit user-facing disclosure at the point of use. Given that memory files often contain sensitive notes, hidden transmission to an HTTP service can violate user expectations and leak confidential data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script rewrites markdown files in place without confirmation, backup, or an obvious safety prompt. In a memory-management skill, these files may contain important operational context, so silent mutation can cause data loss or corruption if the model mis-tags content or the operator targets the wrong files.

Content

No source excerpt is available for this finding.

Tainted flow: 'new_text' from pathlib.Path.read_text (line 248, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/memory-auto-tag.py (reported line 250)May include surrounding context.

python
new_text = f"---\n{dump_simple_yaml(meta)}\n---\n\n{body.lstrip()}"
            if not args.dry_run:
                p.write_text(new_text, encoding="utf-8")

            tagged += 1
            state.setdefault("files", {})[rel] = {

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script reads local daily memory files and sends their contents to an HTTP API for summarization, which contradicts the expectation of purely local Markdown memory handling unless the endpoint is guaranteed local and trusted. Even when defaulting to 127.0.0.1, the URL is configurable, so sensitive notes, project context, or handoff content can be exfiltrated to a remote service without safeguards in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file transmits daily memory contents to the Ollama generate API with no user-facing notice, consent prompt, or visible data-handling warning. In a memory tool, those files may contain credentials, internal decisions, personal notes, or proprietary context, so silent transmission materially increases privacy and data-leak risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script moves user files into an archive location automatically once age and metadata conditions match, with no interactive confirmation or prominent warning at the point of mutation. In a memory-management skill operating over local Markdown files, silent file relocation can cause unintended data loss, operator confusion, or break workflows that expect files to remain in place.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/memory-compact.py (reported line 156)May include surrounding context.

python
if not args.dry_run:
        sem = ws / "skills" / "duru-memory" / "scripts" / "memory-semantic-search.py"
        if sem.exists():
            subprocess.run(["uv", "run", "python", str(sem), "warmup", str(ws), "--build-only"], check=False, cwd=str(ws / "skills" / "duru-memory"))

    print(json.dumps({
        "workspace": str(ws),

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/memory-forget.py (reported line 73)May include surrounding context.

python
if not args.dry_run:
        sem = ws / "skills" / "duru-memory" / "scripts" / "memory-semantic-search.py"
        if sem.exists():
            subprocess.run(["uv", "run", "python", str(sem), "warmup", str(ws), "--build-only"], check=False, cwd=str(ws / "skills" / "duru-memory"))

    print(json.dumps({
        "workspace": str(ws),

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This script sends query text and indexed markdown chunk contents to an Ollama-compatible HTTP embeddings endpoint, which means potentially sensitive memory data leaves the local file context and is exposed to another service process. Even though the default URL is localhost, the endpoint is configurable and the script provides no explicit warning, consent prompt, or restriction to prevent accidental transmission to a remote host, making disclosure of secrets, notes, or handoff data plausible.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: sqlite-vec has 2 known advisory(ies) (CVE-2024-46488 (Heap-based Buffer Overflow in sqlite-vec); CVE-2024-46488 (Heap-based Buffer Overflow in sqlite-vec)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The dependency on sqlite-vec is unpinned even though the package has known published advisories, including a heap-based buffer overflow. Because no version constraint is specified, builds may resolve to an affected release or change over time, making the security posture unverifiable and increasing supply-chain risk for a component that processes SQLite/vector data in local memory workflows.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: pyyaml has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency on PyYAML is unpinned despite multiple historical security advisories, including unsafe deserialization issues. In a memory-management skill that may parse local structured content, an affected PyYAML version could become dangerous if untrusted YAML is ever loaded, and the lack of version pinning makes it impossible to verify that a safe release will be installed consistently.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

After writing summaries, the script launches an external command via subprocess to re-sync a semantic index. Spawning a separate process is not an obvious requirement of maintaining Markdown memory files and is not reflected in the manifest's stated scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The script launches another Python process after archiving, which is a secondary action beyond the core file scan loop. While this may support the skill's purpose, the script does not disclose to the user that it will invoke an external command unless they inspect the code.

Content

No source excerpt is available for this finding.