Back to skill

Security audit

Agent Memento

Security checks for vulnerabilities and agentic risk

Overview

This skill is disclosed as an autonomous coding system, but it needs Review because it can run repeatedly in the background, mutate projects broadly, and exposes under-protected dashboard controls.

Install only in an isolated VM, container, or disposable worktree. Do not run it in an existing repository with valuable uncommitted changes, do not expose the dashboard beyond localhost without authentication, review MASTER_PLAN verify commands as executable code, and update dashboard dependencies before relying on it.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (3)

T01 · Skill Instruction Hijacking

Error
Location
dashboard/server.js:18
Finding

Unauthenticated Dashboard Enables Persistent Instruction Injection into Autonomous Workers

Content
View full analysis
{ const { mode } = req.body; let content = fs.readFileSync(PLAN_PATH, 'utf-8'); content = content.replace(/tick_mode:\s*\w+/, `tick_mode: ${mode}`); fs.writeFileSync(PLAN_PATH, content); res.json({ success: true, mode }); }); // Add Note app.post('/api/notes', (req, res) => { const { target, text } = req.body; const now = new Date().toISOString().replace('Z', ''); const entry = `\n### [NOTE] ${now} → ${target}\n${text}\n`; let content = fs.readFileSync(NOTES_PATH, 'utf-8'); if (content.includes('## Active Notes')) { content = content.replace('## Active Notes', `## Active Notes\n${entry}`); } else { content += entry; } fs.writeFileSync(NOTES_PATH, content); res.json({ success: true }); }); ``` The generated worker prompt explicitly trusts these persisted notes: ```markdown - **Context Loading**: Read `MASTER_PLAN.md`, `PROJECT_MAP.md`, and `HUMAN_NOTES.md`. ``` ### Technical Analysis The dashboard permits a caller-selected listening interface through `--host`, enables unrestricted CORS, and exposes state-changing API routes without authentication, authorization, CSRF protection, origin restrictions, or meaningful request validation. The `/api/notes` endpoint writes arbitrary caller-controlled text into `HUMAN_NOTES.md`. Scheduled OpenClaw workers are explicitly instructed to read that ...[truncated 2196 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/init_memento.sh:5
Finding

Unchecked Project Name Allows Path Traversal and Initialization Outside the Intended Projects Directory

Content
View full analysis
" exit 1 fi PROJECT_NAME=$1 PROJECT_DIR="$(pwd)/projects/$PROJECT_NAME" echo "🚀 Initializing Agent Memento Framework (v0.2) for: $PROJECT_NAME" # Create project scaffolding mkdir -p "$PROJECT_DIR"/{docs,src,logs,scripts} ``` The resulting path is later used for repository initialization: ```bash # Initialize Git cd "$PROJECT_DIR" git init git add . git commit -m "chore: memento framework init" ``` ### Technical Analysis The script treats its sole command-line argument as a project name but performs no validation or canonical containment check. Because the argument is directly appended to `$(pwd)/projects/`, traversal components such as `../` can escape the intended base directory. Quoting prevents shell metacharacter injection but does not prevent filesystem path traversal. Once the target escapes the base directory, the script creates directories and overwrites fixed files including: - `docs/MASTER_PLAN.md` - `docs/PROJECT_MAP.md` - `docs/TICK_STATUS.md` - `docs/HUMAN_NOTES.md` - `.gitignore` - `.memento_cleanignore` - `scripts/dashboard.sh` - `scripts/memento_tick.sh` - `scripts/tick_worker_system_prompt.md` It then changes into the attacker-selected directory, initializes Git, stages the directory contents, and attempts a commit. If the destination is an existing repository or resides inside one, this can modify repository metadata or stage unintended files. ### Attack Path 1. A user, wrapper script, or agent invokes the initializer with a traversal-bearing name: ```bash bash scripts/init_memento.sh ../../target-directory ``` 2. `PROJECT_DIR` becomes: ```text /projects/../../target-directory ...[truncated 1039 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Explicitly reject absolute paths, path separators, empty values, `.` and `..`. 3. Canonicalize the intended base and destination before creating files: ```bash BASE_DIR="$(realpath -m "$(pwd)/projects")" PROJECT_DIR="$(realpath -m "$BASE_DIR/$PROJECT_NAME")" case "$PROJECT_DIR" in "$BASE_DIR"/*) ;; *) echo "Project path escapes projects directory" >&2; exit 1 ;; esac ``` 4. Refuse to overwrite an existing non-empty directory unless the user supplies an explicit, separately confirmed option. 5. Refuse to initialize inside an existing unrelated Git worktree. 6. Create files with restrictive permissions and use atomic, no-clobber creation where appropriate. 7. Display and require confirmation of the canonical destination before initialization when used interactively. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/init_memento.sh:168
Finding

Repository-Wide Failure Cleanup Can Revert or Hide Unrelated User Changes

Content
View full analysis
> "$STATUS" # Phase 1: 恢复已追踪文件 git checkout -- . # Phase 2: 清理未追踪文件(排除保护列表) if [[ -f ".memento_cleanignore" ]]; then # 读取 ignore 文件并转换为 -e 选项 EXCLUDES=$(awk '{printf "-e %s ", $0}' .memento_cleanignore) git stash push -m "memento-untracked-cleanup-$TIMESTAMP" -u $EXCLUDES else git stash push -m "memento-untracked-cleanup-$TIMESTAMP" -u fi # Phase 3: 兜底——如果还是脏的,紧急 stash if [[ -n $(git status --porcelain) ]]; then git stash --include-untracked -m "memento-emergency-stash-$TIMESTAMP" echo "[$TIMESTAMP] CRITICAL: Emergency stash created. Manual inspection required." >> "$STATUS" fi fi ``` ### Technical Analysis The cleanup logic treats every dirty file in the repository as worker-owned state. It runs `git checkout -- .` across the entire worktree and then performs repository-wide stashing of untracked or remaining changes. This behavior is broader than the documented `context_files` boundary. The script neither records a pre-tick snapshot of worker-owned paths nor checks whether another human or process modified the worktree while the tick was running. `git checkout -- .` discards all unstaged changes to tracked files from the working tree. Subsequent stash operations can remove untracked or staged work from its expected location. Although stashed data may be recoverable, users can reasonably perceive it as lost, and tracked edits discarded by checkout may not be recoverable through the stash created afterward. The README discloses aggressive rollback behavior, but disclosure does not make repository-wide destructive clea ...[truncated 1247 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (43)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
## Meta
- created: 2025-01-15
- last_architect_edit: 2025-01-15T14:30:00
- tick_mode: auto          <!-- auto | paused | stopped -->
- max_retries: 3           <!-- 单任务最大重试次数 -->
- max_tasks_per_tick: 2    <!-- 快任务时允许单 Tick 连续处理上限 -->
- max_diff_lines: 200      <!-- diff size guard 阈值 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
- clean_ignore: .memento_cleanignore
- status_max_entries: 50    <!-- TICK_STATUS.md 最大条目数,超出自动归档 -->
- status_archive_dir: logs/status_archive/
- total_ticks: 0           <!-- 自动递增的 Tick 计数器 -->
- total_tasks: 15          <!-- 自动维护 -->
- completed_tasks: 0       <!-- 自动维护 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
## Phase 2: Integration
<!-- parallel: false -->
<!-- depends: Phase 1 -->

- [ ] `T-201` [MODULE:auth] Connect auth middleware to database
  - verify: `cd src && npm run test:integration && echo PASS`

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

markdown
# HUMAN NOTES

<!-- 格式:每条批注带时间戳和目标(global / 具体 Task ID) -->
<!-- Worker 执行完相关批注后,将 [NOTE] 改为 [NOTE:READ] -->
<!-- Architect 处理完后可归档到底部的 Archive 区 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

markdown
# HUMAN NOTES

<!-- 格式:每条批注带时间戳和目标(global / 具体 Task ID) -->
<!-- Worker 执行完相关批注后,将 [NOTE] 改为 [NOTE:READ] -->
<!-- Architect 处理完后可归档到底部的 Archive 区 -->

Known Vulnerable Dependency: basic-ftp==5.2.0 — 4 advisory(ies): GHSA-6v7q-wjvx-w8wg (basic-ftp: Incomplete CRLF Injection Protection Allows Arbitrary FTP Command Exe); CVE-2026-39983 (basic-ftp has FTP Command Injection via CRLF); CVE-2026-41324 (basic-ftp vulnerable to denial of service via unbounded memory consumption in Cl) +1 more

High
Category
Supply Chain
Confidence
93% confidence
Finding

The lockfile pins basic-ftp 5.2.0, and the reported advisories include FTP command injection via incomplete CRLF protection and denial-of-service conditions. Even though this package is transitive, shipping a known vulnerable version is a real supply-chain risk if any code path uses FTP URL handling or attacker-influenced FTP operations.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: extract-zip==2.0.1 — 2 advisory(ies): CVE-2026-19693 (extract-zip allows arbitrary file writes through symlink archive entries); CVE-2026-56876 (extract-zip unvalidated symlink path traversal)

High
Category
Supply Chain
Confidence
94% confidence
Finding

extract-zip 2.0.1 has advisories for arbitrary file write and symlink path traversal during archive extraction. This is especially concerning in this context because Puppeteer commonly downloads and unpacks browser artifacts, so archive extraction is part of the dependency's expected behavior.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: ip-address==10.1.0 — 2 advisory(ies): CVE-2026-69192 (ip-address: Address4 decodes leading-zero octets as decimal while resolvers deco); CVE-2026-42338 (ip-address has XSS in Address6 HTML-emitting methods)

High
Category
Supply Chain
Confidence
80% confidence
Finding

ip-address 10.1.0 is flagged for address parsing inconsistencies and an HTML-emitting XSS issue. As a transitive dependency under socks, the parsing bug could matter if the application relies on these routines for security decisions, while the XSS aspect is less likely unless HTML-rendering helper methods are exposed.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
90% confidence
Finding

js-yaml 4.1.1 is affected by multiple CPU-consumption issues during parsing of crafted YAML structures. This is a real vulnerability whenever untrusted YAML can reach the parser, and here it is present in the Puppeteer/cosmiconfig configuration path where local or supplied config files may be parsed.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: path-to-regexp==0.1.12 — 1 advisory(ies): CVE-2024-45296 (path-to-regexp vulnerable to Regular Expression Denial of Service via multiple r)

High
Category
Supply Chain
Confidence
95% confidence
Finding

path-to-regexp 0.1.12 is a known ReDoS risk and is embedded in Express routing. If route patterns or matching are exercised by attacker-controlled paths, a crafted request can trigger excessive backtracking and degrade service availability.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: picomatch==2.3.1 — 2 advisory(ies): CVE-2026-33672 (Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Mat); CVE-2026-33671 (Picomatch has a ReDoS vulnerability via extglob quantifiers)

High
Category
Supply Chain
Confidence
80% confidence
Finding

picomatch 2.3.1 is reported vulnerable to ReDoS and method-injection issues in glob parsing. This is a real dependency issue, but exploitability depends on whether untrusted users can supply glob patterns; in this lockfile it is mainly used through chokidar/readdirp, which often operate on developer-controlled patterns rather than public input.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: ws==8.19.0 — 2 advisory(ies): CVE-2026-45736 (ws: Uninitialized memory disclosure); CVE-2026-48779 (ws: Memory exhaustion DoS from tiny fragments and data chunks)

High
Category
Supply Chain
Confidence
92% confidence
Finding

ws 8.19.0 is flagged for uninitialized memory disclosure and memory exhaustion from fragmented frames. This is particularly relevant because ws is a direct dependency of the project and WebSocket services are commonly exposed to remote clients, making both confidentiality and availability impacts plausible.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: ws==8.19.0 — 2 advisory(ies): CVE-2026-45736 (ws: Uninitialized memory disclosure); CVE-2026-48779 (ws: Memory exhaustion DoS from tiny fragments and data chunks)

High
Category
Supply Chain
Confidence
85% confidence
Finding

The project declares ws with a caret range from 8.16.0, and the static analysis indicates resolution to ws 8.19.0, which is affected by memory disclosure and memory exhaustion DoS advisories. Because this package is used for WebSocket handling in a dashboard application, a reachable vulnerable ws version could expose sensitive process memory or allow remote denial of service via crafted WebSocket traffic.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · dashboard/public/index.html (reported line 285)May include surrounding context.

html
</head>
<body>

    <!-- Hero Progress Bar -->
    <div class="hero-panel">
        <div class="hero-info">
            <h1 class="hero-title" style="display: flex; flex-direction: column; align-items: flex-start; gap: 8px;">

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/init_memento.sh (reported line 81)May include surrounding context.

sh
node_modules/
__pycache__/
logs/
.env
IGNORE

cat << 'CIGNORE' > "$PROJECT_DIR/.memento_cleanignore"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/init_memento.sh (reported line 86)May include surrounding context.

sh
node_modules/
__pycache__/
logs/
.env
IGNORE

cat << 'CIGNORE' > "$PROJECT_DIR/.memento_cleanignore"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
# 如果一切正常且之前有告警,清除告警
if [[ $BLOCKED_COUNT -eq 0 && $CIRCUIT_BROKEN -eq 0 && -f "$PROJECT_DIR/.memento_alert" ]]; then
  rm -f "$PROJECT_DIR/.memento_alert"
fi

# 增加总 Tick 数

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/init_memento.sh (reported line 218)May include surrounding context.

sh
# 如果一切正常且之前有告警,清除告警
if [[ $BLOCKED_COUNT -eq 0 && $CIRCUIT_BROKEN -eq 0 && -f "$PROJECT_DIR/.memento_alert" ]]; then
  rm -f "$PROJECT_DIR/.memento_alert"
fi

# 增加总 Tick 数

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

This README explicitly describes a highly privileged autonomous shell pipeline that executes commands from the verify field of MASTER_PLAN.md. Even though it includes warnings, the design still enables arbitrary command execution driven by mutable project content, which is dangerous because a poisoned plan file, prompt injection, or unsafe task authoring could cause destructive local actions or data exfiltration.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

md
> ⚠️ **Security & Risk Warning**:
> This skill deploys a highly privileged autonomous shell pipeline. Please read carefully before initializing:
> 1. **Arbitrary Command Execution**: The core Tick Engine (`memento_tick.sh`) strictly and autonomously executes commands defined in the `verify` field of your `MASTER_PLAN.md`. Always run this system in an isolated Virtual Machine or Sandbox environment to prevent unintended side effects.
> 2. **Automated Git Rollbacks**: On task failure, the system executes `git checkout -- .` and `git stash push -u` to revert the workspace to a clean state. **Never initialize Memento in a directory containing pre-existing valuable files or untracked manual edits**, as they may be inadvertently stashed or overwritten.
> 3. **Optional HTTP Directory Exposure**: The companion Dashboard can run a Node.js web server to statically mount and serve your entire project directory via the `/preview` endpoint (if started with `--enable-preview`). **Do not place API keys, secrets, or sensitive private files in the project directory**.

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

Persisting memento_tick.sh via cron creates an unattended recurring execution path for a script that the README says can run autonomous commands and perform destructive git recovery actions. This increases risk because compromise or misconfiguration is not a one-time event: harmful behavior will reoccur automatically every 5 minutes until discovered and stopped.

Content

Scanner excerpt · README.md (reported line 78)May include surrounding context.

  1. Wire it to crontab:
    bash
    crontab -e
    # Add: */5 * * * * /path/to/MyProject/scripts/memento_tick.sh
    

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The line describes a language-enforcement behavior: if MASTER_PLAN.md is in Chinese, all logs, git commits, and code comments will be forcibly output in Chinese. The policy allows locale constraints only when the user is offered a language choice or the constraint is clearly justified as region-specific; neither is present here.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

The README instructs users to install a persistent cron job that repeatedly executes a project script with high automation privileges. In the context of this skill, the same README also warns that the engine performs arbitrary code generation/execution and rollback operations, so persistence increases the blast radius of mistakes, malicious prompt influence, or later script tampering by causing unattended recurring execution.

Content

Scanner excerpt · README_zh.md (reported line 79)May include surrounding context.

  1. 将脉冲挂上机器系统:
    bash
    crontab -e
    # 加入:*/5 * * * * /path/to/MyProject/scripts/memento_tick.sh
    

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill exposes shell and environment-driven behavior but does not declare an explicit tool scope or allowed-tools boundary. In a framework that can execute shell-capable skills, this creates an authorization gap where reviewers and users cannot easily tell what execution powers the skill expects, increasing the chance of unintended command execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill's main instructional content switches into Chinese and continues to rely heavily on Chinese throughout the document, but it does not state that this is a region-specific skill or offer the user a language/locale choice. This can violate language/locale policy expectations for general-purpose skills that should not impose a specific language without opt-in.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
96% confidence
Finding

The skill explicitly instructs the user to install a cron job that repeatedly launches an autonomous agent. Persistent scheduled execution materially increases risk because mistakes, prompt injection, or malicious task definitions can be re-executed unattended over time, amplifying damage beyond a one-off run.

Content

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

  1. 在主对话中让 Architect 填写 MASTER_PLAN.md 和 PROJECT_MAP.md
  2. 启动自动执行:
    bash
    crontab -e
    # 添加:*/5 * * * * /path/to/MyProject/scripts/memento_tick.sh
    
  3. (可选)启动 Dashboard 看板监控:

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
dashboard/server.js:131