/

CVE-2026-71269

Severity:

HIGH RISK

(7.2)

Path Traversal (CWE-22) in Node-RED Library Storage

CVE-2026-71269

Received

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read and Write, Potential Remote Code Execution

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in Node-RED's local-filesystem library storage module allows authenticated users to access files outside the intended library directory. Depending on permissions, an attacker may read arbitrary files or write attacker-controlled content to sensitive locations, which could enable remote code execution.

Affected context

The vulnerability occurs in Node-RED deployments using the local-filesystem library storage module and exposing the library API endpoints. It affects requests that pass user-controlled path data to library entry retrieval or storage operations without sufficient normalization and directory-containment enforcement. Read access may be possible with a read-only-scoped authenticated token, while arbitrary file writes require the corresponding write permission.

Exploit preconditions

  • Attack surface: The authenticated library API exposed through GET and POST requests under /library/:lib/:type/*path
  • Required access: Authentication is required; read access may be sufficient for file disclosure, while write access is required for file modification
  • Trigger point: Library entry retrieval or saving through the local-filesystem storage implementation
  • Why exploitation is possible: User-controlled path components are combined with the library directory without reliable traversal filtering, canonical containment checks, or prefix verification

Why this happens

The underlying bug is improper restriction of externally influenced file paths, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). The storage implementation uses a user-controlled path when constructing filesystem locations but does not consistently canonicalize the result and verify that it remains beneath the intended library root. This allows path resolution to escape the configured storage boundary.

Potential impact

  • Attackers may read sensitive files accessible to the Node-RED process
  • Attackers may overwrite or create files outside the intended library directory
  • Application configuration, credentials, or source files could be exposed or altered
  • Persistence mechanisms such as authorized keys or scheduled tasks could be modified
  • The Node-RED host may be compromised, depending on process privileges and filesystem controls

General mitigation guidance

Mitigation generally focuses on treating all path components as untrusted and enforcing the storage boundary after path resolution.

Common defensive patterns include:

  • Canonicalizing candidate paths before filesystem access
  • Verifying that resolved paths remain within the configured library root
  • Rejecting traversal components and ambiguous path encodings
  • Using filesystem APIs that constrain operations to an approved directory where available
  • Separating read and write permissions and applying least privilege to service accounts
  • Restricting write access to sensitive host locations and using read-only filesystem controls where practical
  • Limiting the Node-RED process's access to credentials, SSH configuration, scheduled-task directories, and other high-impact paths
  • Enforcing authentication, narrowly scoped tokens, and network-level access controls for library endpoints

How teams detect issues like this

Detection can include static analysis and review of filesystem APIs that concatenate or join request-derived values with directory paths. Code review should look for missing canonicalization, containment checks, encoded traversal handling, and inconsistent validation between read and write operations.

Runtime monitoring may identify unusual library API requests, access to unexpected filesystem locations, changes to sensitive files, or Node-RED processes creating files outside approved directories. CI and policy checks can require centralized safe-path helpers and reject direct use of request path parameters in filesystem operations. Automated security review tools may help flag these patterns, but findings should be validated against deployment permissions.

Sources

SourceLink
github.comgithub.com/node-red/node-red
github.comgithub.com/node-red/node-red/blob/master/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/library.js

Frequently asked

questions

It may be exploitable over the network when the Node-RED library API is reachable and the attacker has valid authentication. Exposure depends on network controls and endpoint configuration.

Read access may permit file disclosure through the retrieval path, including access granted by a read-only-scoped token. Writing files requires authorization to use the save operation.

Resolve user-influenced paths against an approved library root, then verify that the canonical result remains within that root before performing any filesystem operation. Reject ambiguous or traversal-oriented path forms.

Centralize safe-path handling, avoid direct concatenation of request paths, apply least privilege to the Node-RED process, restrict sensitive filesystem locations, and test both encoded and normalized path variants in CI and security reviews.

Find out what's already
exploitable in your codebase.