/

CVE-2026-44729

Severity:

HIGH RISK

(8.7)

XSS in Twenty CRM File Serving Endpoints

CVE-2026-44729

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to account takeover and data exposure

Severity:

HIGH RISK

(8.7)

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

Twenty CRM's file serving endpoints deliver uploaded content without specifying key HTTP response headers, causing uploaded HTML files to be rendered directly in the browser.

An authenticated attacker can upload a malicious HTML file with JavaScript that, when opened by another user, executes in the context of the Twenty CRM domain, potentially enabling session hijacking, account takeover, and sensitive data theft.

Affected context

This vulnerability appears in Twenty CRM deployments that allow users to upload files via the /files/* and /file/:fileFolder/:id endpoints.

It is most relevant when:

  • Users can upload arbitrary file types (including .html or content interpreted as HTML by browsers).
  • Download or view links to uploaded files are shared or accessible to other authenticated users.
  • The CRM is accessed through standard web browsers that execute JavaScript for responses served under the application's domain.

Exploit preconditions

  • Attack surface: Authenticated HTTP endpoints responsible for uploading and serving files.
  • Required access: Attacker must have a valid account or otherwise be able to upload files to the CRM.
  • Trigger point: Another user (or the attacker themselves) opens or directly navigates to the uploaded file's URL, such as /files/* or /file/:fileFolder/:id.
  • Why exploitation is possible: The server streams file content with fileStream.pipe(res) without setting Content-Type, Content-Disposition, or X-Content-Type-Options headers. Browsers may interpret uploaded content as active HTML/JavaScript, causing it to execute within the origin of the Twenty CRM application.

Why this happens

The core issue stems from improper output handling for user-supplied files.

Instead of treating all uploaded content as opaque downloadable data, the application streams it back to the browser without explicit response headers controlling how the browser should interpret the content.

When HTML or HTML-like content is served without a restrictive Content-Type or X-Content-Type-Options: nosniff, browsers may render it as a full HTML document, executing embedded scripts in the application's origin.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where attacker-supplied content is returned to clients and executed in a trusted context.

Potential impact

  • Attackers may execute arbitrary JavaScript in the victim's browser under the Twenty CRM origin.
  • Session tokens and authentication credentials could be stolen, enabling account takeover.
  • Sensitive CRM data (contacts, deals, notes, emails, etc.) can be read or exfiltrated via script.
  • Actions may be performed on behalf of victims (e.g., creating or modifying records) via forged requests.
  • Malicious content can be used as a foothold for broader phishing or social engineering campaigns against CRM users.

General mitigation guidance

Effective mitigation focuses on treating uploaded files as untrusted and controlling how they are presented to clients:

  • Serve all user-uploaded files with explicit, restrictive Content-Type headers matching their intended media type and avoid generic types that browsers treat as HTML.
  • Use Content-Disposition: attachment for files that should not be rendered inline, forcing download instead of in-browser execution where appropriate.
  • Set X-Content-Type-Options: nosniff to prevent browsers from content-sniffing and reinterpreting file types as HTML or script.
  • Maintain a strict allowlist of permitted file types and reject or sanitize uploads that could be interpreted as active content (e.g., HTML, SVG with scripts).
  • Isolate file delivery on a separate, cookieless domain or subdomain where feasible, so that even if HTML executes, it lacks access to CRM session cookies and sensitive APIs.
  • Apply least-privilege principles to any components handling file uploads and serving responses, and avoid tying them directly to authenticated application state where possible.

How teams detect issues like this

Organizations can identify similar issues through a combination of review and automated checks:

  • Static analysis and code review: Look for file-serving logic (e.g., stream.pipe(res), res.sendFile, or direct filesystem reads) where response headers are not explicitly set and user-controlled files are returned.
  • Security testing: Use browser-based testing to upload HTML or script-containing files and observe how they are rendered; note any execution within the main application origin.
  • Policy enforcement: Establish coding guidelines that require setting Content-Type, Content-Disposition, and X-Content-Type-Options for file responses, enforced via linters or custom checks in CI pipelines.
  • Logging and monitoring: Track unusual access patterns to uploaded file URLs, particularly those with file extensions commonly associated with active content, and correlate with anomalous user actions.

Sources

SourceLink
github.comgithub.com/twentyhq/twenty/security/advisories/GHSA-f5h2-3qw5-3qp7

Frequently asked

questions

Exploitation is limited to authenticated contexts, but any user who can upload files could craft a malicious HTML payload and persuade other users to open the file, leading to code execution in their browsers.

Not necessarily. The attacker primarily needs the ability to upload files and share or otherwise expose the resulting file URL. Standard user-level access that permits file uploads is often sufficient.

The safest pattern is to strictly control how uploaded files are served: ensure explicit, correct Content-Type headers, set Content-Disposition: attachment where inline rendering is unnecessary, apply X-Content-Type-Options: nosniff, and consider hosting uploaded files on a separate, non-authenticated domain to isolate them from application sessions.

Adopt a consistent design for file handling: treat all uploads as untrusted, implement type-based allowlists, enforce response header policies, and incorporate security-focused code review and automated checks for endpoints that serve user-controlled content.

Find out what's already
exploitable in your codebase.