VYPR
High severityNVD Advisory· Published Feb 4, 2026· Updated Feb 5, 2026

n8n Improper CSP Enforcement in Webhook Responses May Allow Stored XSS

CVE-2026-25051

Description

n8n is an open source workflow automation platform. Prior to version 1.123.2, a Cross-Site Scripting (XSS) vulnerability has been identified in the handling of webhook responses and related HTTP endpoints. Under certain conditions, the Content Security Policy (CSP) sandbox protection intended to isolate HTML responses may not be applied correctly. An authenticated user with permission to create or modify workflows could abuse this to execute malicious scripts with same-origin privileges when other users interact with the crafted workflow. This could lead to session hijacking and account takeover. This issue has been patched in version 1.123.2.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
n8nnpm
>= 1.123.0, < 1.123.21.123.2
n8nnpm
< 1.122.51.122.5

Affected products

1

Patches

2
ced34c0f93ab

fix(core): Fix html header check (#22713)

https://github.com/n8n-io/n8nTomi TurtiainenDec 4, 2025via ghsa
2 files changed · +7 3
  • packages/core/src/html-sandbox.ts+1 1 modified
    @@ -17,7 +17,7 @@ export const getWebhookSandboxCSP = (): string => {
      * as HTML.
      */
     export const isHtmlRenderedContentType = (contentType: string) => {
    -	const contentTypeLower = contentType.toLowerCase();
    +	const contentTypeLower = contentType.trim().toLowerCase();
     
     	return (
     		// The content-type can also contain a charset, e.g. "text/html; charset=utf-8"
    
  • packages/core/src/__tests__/html-sandbox.test.ts+6 2 modified
    @@ -75,11 +75,15 @@ describe('isHtmlRenderedContentType', () => {
     		});
     	});
     
    +	it('should handle content type with extra spaces', () => {
    +		expect(isHtmlRenderedContentType('  text/html')).toBe(true);
    +		expect(isHtmlRenderedContentType('text/html  ')).toBe(true);
    +		expect(isHtmlRenderedContentType('  text/html  ')).toBe(true);
    +	});
    +
     	it('should handle edge cases', () => {
     		expect(isHtmlRenderedContentType('text/htmlsomething')).toBe(true);
     		expect(isHtmlRenderedContentType('application/xhtml+xmlsomething')).toBe(true);
    -		expect(isHtmlRenderedContentType(' text/html')).toBe(false);
    -		expect(isHtmlRenderedContentType('text/html ')).toBe(true);
     	});
     });
     
    
e8cf4d6bb3af

fix(core): Fix html header check (#22713)

https://github.com/n8n-io/n8nTomi TurtiainenDec 4, 2025via ghsa
2 files changed · +7 3
  • packages/core/src/html-sandbox.ts+1 1 modified
    @@ -17,7 +17,7 @@ export const getWebhookSandboxCSP = (): string => {
      * as HTML.
      */
     export const isHtmlRenderedContentType = (contentType: string) => {
    -	const contentTypeLower = contentType.toLowerCase();
    +	const contentTypeLower = contentType.trim().toLowerCase();
     
     	return (
     		// The content-type can also contain a charset, e.g. "text/html; charset=utf-8"
    
  • packages/core/src/__tests__/html-sandbox.test.ts+6 2 modified
    @@ -75,11 +75,15 @@ describe('isHtmlRenderedContentType', () => {
     		});
     	});
     
    +	it('should handle content type with extra spaces', () => {
    +		expect(isHtmlRenderedContentType('  text/html')).toBe(true);
    +		expect(isHtmlRenderedContentType('text/html  ')).toBe(true);
    +		expect(isHtmlRenderedContentType('  text/html  ')).toBe(true);
    +	});
    +
     	it('should handle edge cases', () => {
     		expect(isHtmlRenderedContentType('text/htmlsomething')).toBe(true);
     		expect(isHtmlRenderedContentType('application/xhtml+xmlsomething')).toBe(true);
    -		expect(isHtmlRenderedContentType(' text/html')).toBe(false);
    -		expect(isHtmlRenderedContentType('text/html ')).toBe(true);
     	});
     });
     
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.