# GHSA-x82f-27x3-q89c: OpenClaw's TOCTOU symlink race in writeFileWithinRoot could create or truncate files outside root boundaries

> An attacker can exploit a race condition to create or truncate files outside the intended root directory, potentially compromising system integrity.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not stated
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Mar 2026

## What is GHSA-x82f-27x3-q89c?

GHSA-x82f-27x3-q89c is a vulnerability in openclaw, published on 2 Mar 2026. 

### Official description

### Summary
A symlink-retarget TOCTOU race in `writeFileWithinRoot` could point an attacker-controlled path alias outside the configured root between resolution and write operations.

### Impact
Affected versions could cause out-of-root write side effects (including file creation or truncation) before final boundary validation.

### Fix
Root-scoped write flow now opens existing files without pre-truncation, creates missing files with exclusive create semantics, truncates only after post-open identity/boundary checks, and removes out-of-root artifacts when a race is detected.

### Affected and Patched Versions
- Affected: `<= 2026.2.26`
- Patched: `2026.3.1`

## Which versions are affected by GHSA-x82f-27x3-q89c?

2 open source packages ship an affected version, including openclaw.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openclaw` | npm | All versions | 2026.3.1 |
| `openclaw` | npm | All versions | 2026.3.1 |

## How do I fix GHSA-x82f-27x3-q89c?

Upgrade openclaw to 2026.3.1 or later.

## Is GHSA-x82f-27x3-q89c being exploited?

There is no known exploitation of GHSA-x82f-27x3-q89c in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-x82f-27x3-q89c and fix it if it is affected.

What it is: GHSA-x82f-27x3-q89c is a vulnerability in openclaw, published on 2 Mar 2026. 
Exploitation: There is no known exploitation of GHSA-x82f-27x3-q89c in the wild and no public exploit code.

Affected packages and fixed versions:
- openclaw (npm): affected all versions; fixed in 2026.3.1
- openclaw (npm): affected all versions; fixed in 2026.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-x82f-27x3-q89c/ (Markdown: https://insights.sbomify.com/GHSA-x82f-27x3-q89c/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-x82f-27x3-q89c

---
From sbomify Insights: https://insights.sbomify.com/GHSA-x82f-27x3-q89c/
Summaries are generated and may contain mistakes; the official description above is the record.
