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

- Severity: High (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-03-02T21:55:25.000Z
- Modified: 2026-03-04T15:17:29.322Z
- Weaknesses: CWE-59, CWE-367

## 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`

(As written by GitHub Advisory Database.)

## Affected

- openclaw (npm): before 2026.3.1

## References

- <https://github.com/openclaw/openclaw/security/advisories/GHSA-x82f-27x3-q89c> (web)
- <https://github.com/openclaw/openclaw> (package)

## Sources

- GitHub Advisory Database: [GHSA-x82f-27x3-q89c](https://github.com/advisories/GHSA-x82f-27x3-q89c), CC-BY-4.0, modified 2026-03-04

---

Page: https://cve.day/GHSA-x82f-27x3-q89c · Whole record: https://cve.day/GHSA-x82f-27x3-q89c.json · Rebuilt by cve.day 2026-11-25T22:56:46.991Z
