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

CVE-2026-22171: OpenClaw vulnerable to path traversal in Feishu media temp-file naming allows writes outside os.tmpdir()

mediumCVSS 4.0 6.9GHSA-vj3g-5px3-gr46

OpenClaw up to 2026.2.17 built temporary file paths from Feishu imageKey and fileKey values in extensions/feishu/src/media.ts, without cleaning them. Traversal segments in a key could move the download write outside os.tmpdir(). Upgrade the npm package openclaw to 2026.2.19.

Published Mar 3, 2026 · Updated Mar 19, 2026 · Analysis Oct 31, 2026

What an attacker can do

When OpenClaw downloads Feishu media, it interpolated the media key straight into a temp-file path. A key containing ../ could escape the temp directory, so the downloaded bytes landed at a path the attacker chose, within the permissions of the OpenClaw process.

The advisory frames the precondition as the attacker controlling the key values that come back to the client, for example through a compromised upstream response path. That is a high bar compared with a plain malicious chat message. The CVSS 4.0 vector shows network access, no privileges and active user involvement.

If exploited, the result is an arbitrary file write. The attacker influences where the bytes go, and the content is the downloaded media. Files such as shell profiles, scheduled-job files or config that the process can write are the usual targets, though the advisory does not name one. The CVSS vector rates confidentiality high and integrity none, which sits oddly with a write primitive.

Who is affected

npm package openclaw, versions up to and including 2026.2.17, per the advisory. The data lists everything before 2026.2.19 as vulnerable. Only deployments that use the Feishu extension are exposed. Check your version:

npm ls openclaw

openclaw

Ecosystem
npm
Affected
< 2026.2.19
Fixed in
2026.2.19
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.2.19.

npm install [email protected]

The fix, in commits c821099157a9767d4df208c6b12f214946507871, cdb00fe2428000e7a08f9b7848784a0049176705 and ec232a9e2dff60f0e3d7e827a7c868db5254473f, stops naming temp files from keys. It also isolates SDK writeFile calls in per-download mkdtemp directories with cleanup, validates Feishu keys at the trust boundary, and adds a repository test against dynamic path.join(os.tmpdir(), ...) patterns.

How to tell if you were hit

Look for files created outside the OpenClaw temp directory around the time of Feishu media downloads, and for Feishu imageKey or fileKey values containing .. or path separators in your logs or traffic captures. If you do not run the Feishu extension, there is nothing to look for.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

OpenClaw’s Feishu media download flow used untrusted Feishu media keys (imageKey / fileKey) when building temporary file paths in extensions/feishu/src/media.ts. Because those keys were interpolated directly into temp-file paths, traversal segments could escape the temp directory and redirect writes outside os.tmpdir().

Impact

This is an arbitrary file write issue (within the OpenClaw process file permissions). If an attacker can control Feishu media key values returned to the client (for example via compromised upstream response path), they can influence where downloaded bytes are written.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Latest published npm version at triage: 2026.2.17
  • Affected versions: <= 2026.2.17
  • Fixed version: 2026.2.19

Fix Commit(s)

  • c821099157a9767d4df208c6b12f214946507871
  • cdb00fe2428000e7a08f9b7848784a0049176705
  • ec232a9e2dff60f0e3d7e827a7c868db5254473f

Remediation

The fix removes key-derived temp-file naming and keeps downloads in safe temp locations. Additional hardening isolates SDK writeFile calls in per-download temp directories (mkdtemp) with deterministic cleanup, enforces Feishu key trust-boundary validation, and adds a repository guard test against dynamic path.join(os.tmpdir(), \...${...}\) patterns in runtime code.

OpenClaw thanks @allsmog for reporting.

Credited to allsmog.

Questions

Do I need the Feishu extension for CVE-2026-22171?

Yes. The flaw is in extensions/feishu/src/media.ts, in the Feishu media download flow.

What does an attacker need?

Control over the Feishu media key values returned to the OpenClaw client, for example through a compromised upstream response path, according to the advisory.

What is the fixed version?

2026.2.19. Versions up to 2026.2.17 are named as affected.

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