/

CVE-2025-61917

Severity:

HIGH RISK

(7.7)

Information Disclosure via Uninitialized Memory

CVE-2025-61917

Analyzed

Vulnerability type

Category:

Information Disclosure via Uninitialized Memory

CWE:

CWE-200, CWE-668

Impact:

Exposure of sensitive data from process memory to untrusted workflow code

Severity:

HIGH RISK

(7.7)

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

n8n's task runner used Buffer.allocUnsafe() and Buffer.allocUnsafeSlow() to allocate memory for untrusted code, potentially returning uninitialized buffers containing residual data from the same Node.js process.

When a workflow or task could influence or read these buffers, it might access sensitive information from prior requests or tasks, including secrets and tokens, leading to information disclosure.

Affected context

This vulnerability affects n8n deployments running versions 1.65.0 through 1.114.2 where:

  • The task runner executes user-controlled or workspace-controlled workflow logic.
  • Buffer allocation within the task runner relies on Buffer.allocUnsafe() or Buffer.allocUnsafeSlow().
  • Workflows, integrations, or custom code can read data from these buffers.

In such environments, different workflows or tasks may share the same Node.js process, enabling accidental leakage of residual in-process data between tasks.

Exploit preconditions

  • Attack surface: Workflow tasks and custom code executed by the n8n task runner.
  • Required access: Ability to create or run workflows or nodes that can interact with buffers allocated by the task runner (for example, tenant or project-level access to define automation logic).
  • Trigger point: Execution of a workflow or task that causes buffer allocation through Buffer.allocUnsafe() or Buffer.allocUnsafeSlow(), followed by reading from the buffer without fully initializing it.
  • Why exploitation is possible: Unsafe buffer allocation returns memory that may contain residual contents from previous operations in the same process. When untrusted workflow logic can inspect these buffers, it can infer or directly read data that was not intended to be exposed.

Why this happens

The underlying flaw arises from using Node.js APIs that intentionally skip memory initialization (Buffer.allocUnsafe() and Buffer.allocUnsafeSlow()) in contexts where buffer contents may be observable by untrusted or semi-trusted code.

These APIs can return memory segments containing remnants of prior operations within the same process, such as request payloads, access tokens, credentials, or intermediate workflow data. When such buffers are exposed to workflow logic without being overwritten first, this constitutes an information exposure through residual data condition, aligning primarily with CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) and related to CWE-668 (Exposure of Resource to Wrong Sphere), as internal process memory is made visible to a less-privileged execution sphere.

Potential impact

  • Disclosure of secrets or tokens previously processed by other workflows or tasks.
  • Exposure of sensitive business data, such as customer records, internal identifiers, or confidential payloads.
  • Leakage of authentication or session data that could facilitate further compromise in connected systems.
  • Cross-workflow or cross-tenant data exposure in multi-user or multi-tenant n8n deployments.
  • Increased difficulty in achieving data minimization and regulatory compliance due to uncontrolled in-process data leakage.

General mitigation guidance

Effective mitigation focuses on treating all memory that may be observed by untrusted workflow logic as sensitive and ensuring it is fully initialized before use.

Recommended defensive patterns include:

  • Prefer using safe allocation APIs (e.g., Buffer.alloc() in Node.js) for any buffer that can be read from or manipulated by workflow or plugin code.
  • Enforce a policy that no uninitialized memory is ever exposed to user-defined or tenant-defined logic, even if only indirectly.
  • Introduce abstraction layers for buffer handling in the task runner so that low-level memory APIs are not called directly from workflow-related paths.
  • Apply least-privilege principles to workflow execution: restrict what internal data and resources are accessible to tasks, assuming that any accessible buffer contents might be inspected.
  • Implement secure coding guidelines for extensions and custom nodes, discouraging unsafe memory operations and requiring explicit initialization of all buffers.

How teams detect issues like this

Security teams can pursue several detection approaches to surface similar issues:

  • Static analysis: Configure linters or SAST tools to flag usage of Buffer.allocUnsafe() and Buffer.allocUnsafeSlow() in code paths reachable by untrusted or user-defined workflows. Enforce policies that require justification or remediation for such calls.
  • Code review patterns: During code review, treat any use of unsafe buffer allocation APIs as a security smell. Reviewers should verify that buffers are either fully overwritten before exposure or replaced with safe allocation functions.
  • Centralized API enforcement: Wrap buffer allocation in internal utility functions and prohibit direct use of low-level allocation APIs. Automated checks can then focus on the wrapper usage.
  • Runtime monitoring (where feasible): In high-assurance environments, instrument critical paths to log or trace unsafe memory API usage and correlate it with workflow execution contexts.
  • Policy and CI integration: Integrate checks into CI pipelines that reject changes introducing new unsafe allocation patterns in workflow-related modules.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/commit/2c4c2953199733c791f739a40879ae31ca129aba
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-49mx-fj45-q3p6

Frequently asked

questions

Yes, in practice it can be. An attacker who can create or control workflows or custom nodes that are executed by the n8n task runner may be able to read residual data from uninitialized buffers, even if they do not have direct system or shell access.

The attacker generally needs the ability to define or modify workflows, tasks, or custom nodes that run within the affected n8n instance. In multi-tenant or shared environments, a tenant with such capabilities could potentially access data originating from other tenants or users.

The safest pattern is to eliminate unsafe buffer allocations from any path where buffer contents can be observed by untrusted or semi-trusted code. Use buffer allocation APIs that zero-initialize memory, and ensure all buffers are explicitly filled with known data before being read.

Adopt secure coding standards that:

  • Ban or strictly restrict unsafe memory allocation APIs in user-facing or untrusted execution paths.
  • Require code reviews and automated checks for memory-related operations.
  • Encapsulate low-level operations behind vetted utility functions.
  • Treat multi-tenant or extensible components as hostile boundaries, ensuring no internal process state is unintentionally exposed through residual memory.
Find out what's already
exploitable in your codebase.