NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · OpenClaw

CVE-2026-35632: OpenClaw: Symlink Traversal via IDENTITY.md appendFile in agents.create/update (Incomplete Fix for CVE-2026-32013)

mediumCVSS 4.0 6.9 · 3.1 7.1GHSA-7xr2-q9vf-x4r5

OpenClaw's agents.create and agents.update handlers append to IDENTITY.md with no symlink check. If an attacker has planted a symlink at that path, agent name, emoji and avatar text is appended to whatever file it points to. The advisory lists openclaw 2026.2.22 and earlier and names no patched version.

Published Mar 26, 2026 · Updated Apr 18, 2026 · Analysis Oct 31, 2026

What an attacker can do

The earlier fix for CVE-2026-32013 added symlink resolution and workspace boundary checks to agents.files.get and agents.files.set. Two other handlers in src/gateway/server-methods/agents.ts were missed. agents.create and agents.update call fs.appendFile on the workspace's IDENTITY.md, and appendFile follows symlinks.

agents.create first calls ensureAgentWorkspace, which creates IDENTITY.md in exclusive mode (flag wx). If a symlink already sits at that path, the EEXIST error is swallowed, and the append then writes through the link. The researcher's proof of concept pointed IDENTITY.md at a test file and saw the agent's identity lines appended to it.

The attacker needs local access (AV:L) with low privileges: the ability to plant a symlink in the agent workspace and to call the Gateway API. The written text is the agent name, emoji and avatar, only lightly sanitized (whitespace normalization). Pointed at /etc/crontab, ~/.bashrc or ~/.ssh/authorized_keys, that can become code execution, persistence or SSH access. Pointed at a config file, it can break a service.

Who is affected

Affected: the openclaw npm package at 2026.2.22 and earlier, per the advisory. The GitHub data lists no patched version. Other March 2026 OpenClaw fixes say 2026.3.22 or 2026.3.23, but this advisory does not state that they fix this bug, so verify against the source. Check your version:

npm ls openclaw

Then look for symlinks in agent workspaces:

find /path/to/workspaces -name IDENTITY.md -type l

openclaw

Ecosystem
npm
Affected
<= 2026.2.22
Fixed in
No patched version yet
Check
npm ls openclaw

How to fix it

No patched version is named in the advisory. Packages data shows the affected range as 2026.2.22 and earlier with no fixed release. Upgrade to the newest openclaw and check the release notes and the agents.ts handlers for a symlink check on IDENTITY.md before trusting it.

The researcher's control test shows what a fix looks like: the patched endpoint resolves the real path and returns an error, symlink_traversal_blocked, leaving the target file unchanged. Until you have that, restrict who can write into agent workspace directories and who can call agents.create and agents.update, and delete any IDENTITY.md that is a symlink.

How to tell if you were hit

Find symlinks named IDENTITY.md in agent workspace directories (find with -type l). Check sensitive files for stray lines in the form "- Name: ...", "- Emoji: ..." or "- Avatar: ...", especially in /etc/crontab, user crontabs, shell profiles and authorized_keys. Review Gateway logs for agents.create and agents.update calls from unexpected callers, and for new cron entries or SSH keys you did not add.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The patch for CVE-2026-32013 introduced symlink resolution and workspace boundary enforcement for agents.files.get and agents.files.set. However, two other handlers in the same file (agents.create and agents.update) still use raw fs.appendFile on the IDENTITY.md file without any symlink containment check. An attacker who can place a symlink in the agent workspace can hijack the IDENTITY.md path to append attacker-controlled content to arbitrary files on the system.

Details

In src/gateway/server-methods/agents.ts, the agents.create handler constructs the identity path and appends agent metadata without verifying symlinks:

// agents.create — line 283-291
const identityPath = path.join(workspaceDir, DEFAULT_IDENTITY_FILENAME);
const lines = [
  "",
  `- Name: ${safeName}`,
  ...(emoji ? [`- Emoji: ${sanitizeIdentityLine(emoji)}`] : []),
  ...(avatar ? [`- Avatar: ${sanitizeIdentityLine(avatar)}`] : []),
  "",
];
await fs.appendFile(identityPath, lines.join("\n"), "utf-8"); // ← NO SYMLINK CHECK

The agents.update handler has the same issue at line 348-349:

// agents.update — line 348-349
const identityPath = path.join(workspace, DEFAULT_IDENTITY_FILENAME);
await fs.appendFile(identityPath, `\n- Avatar: ${sanitizeIdentityLine(avatar)}\n`, "utf-8"); // ← NO SYMLINK CHECK

fs.appendFile follows symlinks by default. If the IDENTITY.md file in the workspace is a symlink pointing to a sensitive file (e.g., /etc/crontab, ~/.bashrc, or ~/.ssh/authorized_keys), calling agents.create will append the agent identity metadata to that file.

The ensureAgentWorkspace function (called at line 274 before the append) uses exclusive-create mode (flag: 'wx') for IDENTITY.md. If a symlink already exists at that path, the EEXIST error is silently caught, and the subsequent fs.appendFile follows the symlink.

Attack flow:

1. Attacker plants symlink: workspace/IDENTITY.md → /etc/crontab
2. ensureAgentWorkspace skips creation (EEXIST from symlink)
3. fs.appendFile follows symlink → writes to /etc/crontab
4. Attacker-controlled content (name, emoji, avatar) injected into crontab → RCE

PoC

Prerequisites: Docker and Python 3 installed.

Step 1: Build and start the test environment.

cd llm-enhance/cve-finding/RCE/CVE-2026-32013-identity-appendFile-variant-exp/
docker compose up -d --build
sleep 3

Step 2: Run the exploit.

python3 poc_exploit.py

This script:

  1. Plants a symlink IDENTITY.md → /etc/target-file.txt inside the agent workspace
  2. Calls the agents.create API endpoint via HTTP POST
  3. Verifies that the agent identity metadata was appended to /etc/target-file.txt

Step 3: Run the control experiment.

python3 control-patched_realpath.py

Step 4: Cleanup.

docker compose down

Log of Evidence

Exploit output:

=== CVE-2026-32013 Variant: Symlink Traversal via IDENTITY.md appendFile ===
[*] Planting symlink: IDENTITY.md -> /etc/target-file.txt
[*] Symlink: lrwxrwxrwx 1 root root 20 /workspaces/evil-agent/IDENTITY.md -> /etc/target-file.txt
[*] Original /etc/target-file.txt: ORIGINAL_SENSITIVE_CONTENT

[*] Calling agents.create with name='evil-agent'...
[*] API response: {'ok': True, 'agentId': 'evil-agent', 'workspace': '/workspaces/evil-agent'}

[*] /etc/target-file.txt after exploit:
    ORIGINAL_SENSITIVE_CONTENT

- Name: evil-agent
- Emoji: 💀
- Avatar: evil.png

[+] SUCCESS! Symlink traversal confirmed.
[+] fs.appendFile followed IDENTITY.md symlink and wrote to /etc/target-file.txt
[+] Attacker-controlled content injected into arbitrary file.

Control output:

=== CONTROL: Patched agents.create blocks symlink traversal ===
[*] Planting symlink: IDENTITY.md -> /etc/target-file.txt
[*] Original /etc/target-file.txt: ORIGINAL_SENSITIVE_CONTENT

[*] Calling PATCHED agents.create with name='safe-agent'...
[*] API response: {'ok': False, 'error': 'symlink_traversal_blocked', 'realPath': '/etc/target-file.txt'}

[*] /etc/target-file.txt after patched call: ORIGINAL_SENSITIVE_CONTENT

[+] CONTROL PASSED: Patched endpoint detected and blocked symlink traversal.
[+] /etc/target-file.txt remains unchanged.

Impact

An attacker who can plant a symlink in the agent workspace directory can use the agents.create or agents.update gateway API to append attacker-controlled content to arbitrary files on the system. If the target file is:

  • /etc/crontab or user crontab → Remote Code Execution
  • ~/.bashrc or ~/.profile → Persistent code execution on login
  • ~/.ssh/authorized_keys → Unauthorized SSH access
  • Application configuration files → Service disruption

The attacker-controlled content includes the agent name (arbitrary string), emoji, and avatar fields, which are only lightly sanitized (whitespace normalization via sanitizeIdentityLine).

Affected products

  • Ecosystem: npm
  • Package name: openclaw
  • Affected versions: <= 2026.2.22
  • Patched versions: None

Occurrences

| Permalink | Description |
| [https://github.com/openclaw/openclaw/blob/main/src/gateway/server-methods/agents.ts#L283-L291](https://github.com/openclaw/openclaw/blob/main/src/gateway/server-methods/agents.ts#L283-L291) | `agents.create` handler uses `fs.appendFile` on `IDENTITY.md` without symlink resolution or workspace boundary check. |
| [https://github.com/openclaw/openclaw/blob/main/src/gateway/server-methods/agents.ts#L348-L349](https://github.com/openclaw/openclaw/blob/main/src/gateway/server-methods/agents.ts#L348-L349) | `agents.update` handler uses `fs.appendFile` on `IDENTITY.md` without symlink resolution or workspace boundary check. |
| [https://github.com/openclaw/openclaw/blob/main/src/gateway/server-methods/agents.ts#L274](https://github.com/openclaw/openclaw/blob/main/src/gateway/server-methods/agents.ts#L274) | `ensureAgentWorkspace` is called before append, but its exclusive-create (`wx`) flag silently skips existing symlinks (EEXIST). |

Credited to YLChen-007.

Questions

Is there a patched version for CVE-2026-35632?

The advisory lists none. The affected range is 2026.2.22 and earlier with no fixed version. Watch the OpenClaw releases and confirm the handlers check symlinks.

How does this relate to CVE-2026-32013?

It is an incomplete fix. The earlier patch covered agents.files.get and agents.files.set but not agents.create and agents.update, which still append to IDENTITY.md.

Can it be exploited remotely?

The CVSS vector is local (AV:L) with low privileges. The attacker has to place a symlink in the workspace and call the create or update API.

Is it exploited in the wild?

No source reports exploitation, and it is not in CISA's KEV catalog. A proof of concept is included in the advisory. The EPSS score is 0.0042.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More OpenClaw vulnerabilities

All OpenClaw entries