GHSA-hw8v-xxg5-vvvx: Code Injection
Impact
The expression compiler's sanitizer resolved through a dynamically-scoped this, so a class field named sanitize rebound it and reached the Function constructor. On the backend, any expression author could run code in the n8n process; in the editor preview, a member's expression could run as JavaScript in the session of whoever opened the workflow. The patch rejects reserved class-member names.
Patches
The issue has been fixed in n8n versions 1.123.76, 2.37.7, and 2.38.2. Users should upgrade to one of these versions or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Restrict n8n instance access to fully trusted users only. - Avoid granting workflow-create or workflow-edit permissions to untrusted users. - Audit existing workflows for unexpected or unfamiliar expressions in node parameters. - Set N8NEXPRESSIONENGINE=vm.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 2.37.7 - Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 2.38.2 - Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 1.123.76 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 1.123.76 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 2.37.7 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 2.38.2 - Configuration
Set environment variable N8N_EXPRESSION_ENGINE=vm for temporary mitigation.
n8n N8N_EXPRESSION_ENGINE = vm - Compensating control
Restrict n8n instance access to fully trusted users only.
- Compensating control
Avoid granting workflow-create or workflow-edit permissions to untrusted users.
- Compensating control
Audit existing workflows for unexpected or unfamiliar expressions in node parameters.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Backend compromise is possible when an expression author can create an expression that is evaluated by n8n. Editor-preview compromise is possible when a workflow member opens a workflow containing a malicious expression, so users with workflow access may be exposed even if they did not create the expression.
What access does an attacker need?
The attacker needs the ability to author expressions, which can be obtained through workflow-create or workflow-edit permissions. The supplied mitigations specifically advise against granting these permissions to untrusted users.
Which versions contain the fix?
Upgrade to n8n 1.123.76, 2.37.7, 2.38.2, or a later version. These releases reject reserved class-member names used in the vulnerable expression-compilation path.
What can be done while an upgrade is pending?
Limit the instance to fully trusted users, remove workflow-create and workflow-edit permissions from untrusted users, and audit node parameters for unexpected or unfamiliar expressions. Setting N8N_EXPRESSION_ENGINE=vm is also listed as a temporary mitigation, but these measures do not fully remediate the issue.