Skip to content

Stored XSS via BlockNote FileBlock

Moderate
FelixMalfait published GHSA-7w89-7q26-gj7q Apr 21, 2026

Package

blocknote-editor (Twenty CRM)

Affected versions

1.19.0

Patched versions

None

Description

Summary

A Stored Cross-Site Scripting (XSS) vulnerability exists in the BlockNote editor component. Due to a lack of protocol validation in the FileBlock component and insufficient server-side inspection of block content, an attacker can inject a javascript: URI into the url property of a file block. This allows the execution of arbitrary JavaScript when a user clicks on the malicious file attachment.

Details

  1. validateBlocknoteFieldOrThrow() only ensures that the incoming data is a valid JSON array. It does not inspect the internal properties of the blocks, specifically failing to validate the props.url field within blocks of type file.
  2. In FileBlock.tsx (line 103), the block.props.url value is passed directly to the href attribute of an <a> tag without verifying the protocol (e.g., ensuring it starts with http://, https://, or mailto:).

PoC

To reproduce the issue, an attacker can send a createNote mutation with a manipulated blocknote JSON payload. The core of the payload involves a block of type file with a malicious URL:

{
  "type": "file",
  "props": {
    "url": "javascript:void(alert(document.cookie))",
    "name": "POC.pdf",
    "fileCategory": "OTHER"
  }
}

When the editor renders this block, it generates a link similar to:
<a href="javascript:void(alert(document.cookie))">POC.pdf</a>

Impact

An authenticated attacker can target any user (including admins) who has access to the compromised note. Arbitrary JavaScript execution can lead to session hijacking, sensitive data theft (via localStorage or cookies), or unauthorized actions performed on behalf of the victim.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N

CVE ID

CVE-2026-35451

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Credits