CVE-2025-65964: N8n Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-wpqc-h9wp-chmq
CWE-829
Published
Advisory Summary

CVE-2025-65964 is a CRITICAL remote code execution vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting N8n libraries in the npm ecosystem. The issue involves n8n vulnerable to remote code execution via git node custom pre-commit hook. Remediation is available by upgrading affected packages to version 1.119.2.

CVE-2025-65964 at a Glance

CVE Identifier CVE-2025-65964
GHSA Identifier GHSA-wpqc-h9wp-chmq
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-829: Inclusion of Functionality from Untrusted Control Sphere
Affected Product N8n
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-65964

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

n8n fixed: 1.119.2
npm install n8n@1.119.2
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 n8n

How to Check if You Are Affected

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

npm ls n8n

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

Note: The npm ls n8n 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-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In N8n, 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

### Impact The n8n Git node allows workflows to set arbitrary Git configuration values through the _Add Config_ operation. When an attacker-controlled workflow sets `core.hooksPath` to a directory within the cloned repository containing a Git hook such as `pre-commit`, Git executes that hook during subsequent Git operations. Because Git hooks run as local system commands, this behavior can lead to **arbitrary command execution** on the underlying n8n host. Successful exploitation requires the ability to create or modify an n8n workflow that uses the Git node. Affected versions: **≥ 0.123.1 and < 1.119.2** ### Patches This issue has been patched in **n8n version 1.119.2**. All users running affected versions should upgrade to **1.119.2 or later**. ### Workarounds If upgrading is not immediately possible, the following mitigations can reduce exposure: - Exclude the Git node ([Docs](https://n8n-docs.teamlab.info/hosting/securing/blocking-nodes/#exclude-nodes)). - Avoid cloning or interacting with untrusted repositories using the Git Node.

CVE-2025-65964 Affected N8n Versions

1 component(s)
Fixed Versions:
1.119.2
Product / Package Ecosystem Affected Versions Fixed Version
n8n
npm
≥ 0.123.1
< 1.119.2
1.119.2

References

Frequently Asked Questions

What is CVE-2025-65964?
CVE-2025-65964 is a security vulnerability in N8n involving n8n vulnerable to Remote Code Execution via Git Node Custom Pre-Commit Hook under CWE-829: Inclusion of Functionality from Untrusted Control Sphere.
Which N8n versions are affected?
Affected versions include releases prior to 1.119.2 across affected packages: n8n.
What version fixes CVE-2025-65964?
Upgrading to 1.119.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is n8n affected?
Yes, n8n is affected in releases prior to 1.119.2. Upgrade your dependency to 1.119.2 or later.
What CWE is associated with CVE-2025-65964?
CVE-2025-65964 is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere (The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.).
How can I check npm dependencies for CVE-2025-65964?
Run the dependency tree command: 'npm ls n8n'. 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-wpqc-h9wp-chmq",
  "modified" : "2025-12-09T16:28:13Z",
  "published" : "2025-12-08T21:30:07Z",
  "aliases" : [ "CVE-2025-65964" ],
  "summary" : "n8n vulnerable to Remote Code Execution via Git Node Custom Pre-Commit Hook",
  "details" : "### Impact\n\nThe n8n Git node allows workflows to set arbitrary Git configuration values through the _Add Config_ operation. When an attacker-controlled workflow sets `core.hooksPath` to a directory within the cloned repository containing a Git hook such as `pre-commit`, Git executes that hook during subsequent Git operations. Because Git hooks run as local system commands, this behavior can lead to **arbitrary command execution** on the underlying n8n host.\n\nSuccessful exploitation requires the ability to create or modify an n8n workflow that uses the Git node.\n\nAffected versions: **≥ 0.123.1 and < 1.119.2**\n\n### Patches\n\nThis issue has been patched in **n8n version 1.119.2**.\n\nAll users running affected versions should upgrade to **1.119.2 or later**.\n\n### Workarounds\n\nIf upgrading is not immediately possible, the following mitigations can reduce exposure:\n\n- Exclude the Git node ([Docs](https://n8n-docs.teamlab.info/hosting/securing/blocking-nodes/#exclude-nodes)).\n- Avoid cloning or interacting with untrusted repositories using the Git Node.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "n8n"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.123.1"
      }, {
        "fixed" : "1.119.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/n8n-io/n8n/security/advisories/GHSA-wpqc-h9wp-chmq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-65964"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/n8n-io/n8n/commit/d5a1171f95f75def5c3ac577707ab913e22aef04"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/n8n-io/n8n"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/n8n-io/n8n/releases/tag/n8n%401.119.2"
  }, {
    "type" : "WEB",
    "url" : "https://n8n-docs.teamlab.info/hosting/securing/blocking-nodes/#exclude-nodes"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-829" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-08T21:30:07Z",
    "nvd_published_at" : "2025-12-09T00:15:48Z"
  }
}