CVE-2026-22171: Openclaw Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-vj3g-5px3-gr46
CWE-22
Published
Advisory Summary

CVE-2026-22171 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Openclaw libraries in the npm ecosystem. The issue involves openclaw vulnerable to path traversal in feishu media temp-file naming allows writes outside os.tmpdir(). Remediation is available by upgrading affected packages to version 2026.2.19.

CVE-2026-22171 at a Glance

CVE Identifier CVE-2026-22171
GHSA Identifier GHSA-vj3g-5px3-gr46
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Openclaw
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-22171

To remediate this vulnerability, upgrade all affected Openclaw dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

openclaw fixed: 2026.2.19
npm install openclaw@2026.2.19
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls openclaw

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-22171, inspect your project dependencies using npm:

npm ls openclaw

Analyze the terminal output to locate any version of Openclaw in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.2.19), your application is affected.

Note: The npm ls openclaw command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Openclaw, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-22171 Affected Openclaw Versions

1 component(s)
Fixed Versions:
2026.2.19
Product / Package Ecosystem Affected Versions Fixed Version
openclaw
npm
< 2026.2.19
2026.2.19

References

Frequently Asked Questions

What is CVE-2026-22171?
CVE-2026-22171 is a security vulnerability in Openclaw involving OpenClaw vulnerable to path traversal in Feishu media temp-file naming allows writes outside os.tmpdir() under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Openclaw versions are affected?
Affected versions include releases prior to 2026.2.19 across affected packages: openclaw.
What version fixes CVE-2026-22171?
Upgrading to 2026.2.19 (or the latest patched release for your respective branch) resolves the vulnerability.
Is openclaw affected?
Yes, openclaw is affected in releases prior to 2026.2.19. Upgrade your dependency to 2026.2.19 or later.
What CWE is associated with CVE-2026-22171?
CVE-2026-22171 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-22171?
Run the dependency tree command: 'npm ls openclaw'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vj3g-5px3-gr46",
  "modified" : "2026-03-19T18:34:17Z",
  "published" : "2026-03-03T18:42:28Z",
  "aliases" : [ "CVE-2026-22171" ],
  "summary" : "OpenClaw vulnerable to path traversal in Feishu media temp-file naming allows writes outside os.tmpdir()",
  "details" : "## Summary\n\nOpenClaw’s Feishu media download flow used untrusted Feishu media keys (`imageKey` / `fileKey`) when building temporary file paths in `extensions/feishu/src/media.ts`.\nBecause those keys were interpolated directly into temp-file paths, traversal segments could escape the temp directory and redirect writes outside `os.tmpdir()`.\n\n## Impact\n\nThis is an arbitrary file write issue (within the OpenClaw process file permissions).\nIf 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.\n\n## Affected Packages / Versions\n\n- Package: `openclaw` (npm)\n- Latest published npm version at triage: `2026.2.17`\n- Affected versions: `<= 2026.2.17`\n- Fixed version: `2026.2.19`\n\n## Fix Commit(s)\n\n- `c821099157a9767d4df208c6b12f214946507871`\n- `cdb00fe2428000e7a08f9b7848784a0049176705`\n- `ec232a9e2dff60f0e3d7e827a7c868db5254473f`\n\n## Remediation\n\nThe 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.\n\nOpenClaw thanks @allsmog for reporting.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "openclaw"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.2.19"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/openclaw/openclaw/security/advisories/GHSA-vj3g-5px3-gr46"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22171"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openclaw/openclaw/commit/c821099157a9767d4df208c6b12f214946507871"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openclaw/openclaw/commit/cdb00fe2428000e7a08f9b7848784a0049176705"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openclaw/openclaw/commit/ec232a9e2dff60f0e3d7e827a7c868db5254473f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/openclaw/openclaw"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/openclaw-path-traversal-in-feishu-media-temporary-file-naming"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-03T18:42:28Z",
    "nvd_published_at" : "2026-03-18T02:16:21Z"
  }
}