/

CVE-2026-77072

Severity:

HIGH RISK

(7.6)

Stored XSS (CWE-79) in n8n Form Node Completion Page

CVE-2026-77072

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Same-Origin Script Execution and Session Compromise

Severity:

HIGH RISK

(7.6)

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 contains a stored cross-site scripting vulnerability in the Form node's completion page, where response text can be rendered as raw HTML without the intended sandboxing policy.

An authenticated member who can configure a form may cause attacker-controlled script to execute in the n8n origin when visitors submit the resulting public form.

Affected context

The issue occurs in n8n Form node workflows that use the completion page and allow an authenticated member to configure response behavior and response text. Risk increases when a public form is exposed to visitors and the response text remains populated while the response mode is configured through an expression to redirect.

Exploit preconditions

  • Attack surface: The n8n Form node completion page
  • Required access: Authenticated member-level access sufficient to configure the affected form
  • Trigger point: A visitor submits a public form and receives the completion page
  • Why exploitation is possible: The page may render responseText as raw HTML while the sandboxing Content-Security-Policy is not applied for the redirect response mode

Why this happens

The vulnerability results from inconsistent security-policy enforcement and unsanitized HTML rendering. The completion page applies its sandboxing Content-Security-Policy conditionally based on the response mode, while responseText is rendered as raw HTML regardless of that mode. This allows stored attacker-controlled markup and script to execute in the application's origin, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Potential impact

  • Malicious script could execute with the n8n origin
  • A visitor's authenticated session could be targeted
  • Attackers could perform actions available to the affected browser session
  • Sensitive information accessible to the page could be exposed
  • Forms and workflows could be abused to distribute malicious content

General mitigation guidance

Mitigation generally focuses on ensuring that all user-controlled completion content is treated as data rather than executable markup.

Common defensive patterns include:

  • Applying context-appropriate output encoding or strict sanitization before rendering response text
  • Prefering plain-text completion responses or trusted, narrowly defined templates
  • Enforcing the strongest applicable Content-Security-Policy for every completion-page path, including redirect configurations
  • Avoiding security decisions based solely on user-controlled or expression-derived response modes
  • Restricting who may publish or modify public forms
  • Limiting session privileges and administrative capabilities exposed to browser sessions

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying raw HTML insertion into completion or response pages
  • Code review checks for conditional CSP enforcement and inconsistent handling across response modes
  • Tests that submit forms with markup in response fields and verify that it is encoded or safely sanitized
  • Policy enforcement requiring output encoding or approved sanitization libraries for browser-rendered content
  • Monitoring for unexpected script-bearing form responses and unusual browser actions originating from public form pages

Automated security review tools may help identify unsafe DOM or server-side HTML rendering patterns.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-rmr5-775f-jvm2
vulncheck.comvulncheck.com/advisories/n8n-before-stored-xss-via-form-completion-page

Frequently asked

questions

It can be triggered through a public form by a visitor, but exploitation generally requires an authenticated member to configure or publish the malicious form content first.

The described condition requires authenticated member-level access that permits configuring the Form node's response behavior and completion text.

Treat response text as untrusted data by default, apply context-appropriate output encoding or strict sanitization, and enforce a restrictive security policy on every completion-page path.

Use secure rendering APIs, test every response mode for consistent policy enforcement, restrict form configuration privileges, and include stored-XSS cases in automated and manual security reviews.

Find out what's already
exploitable in your codebase.