Skip to main content
Vulnerability Database/CVE-2023-54409

CVE-2023-54409: Frappe HTML Sanitization XSS Vulnerability

CVE-2023-54409 is a cross-site scripting flaw in Frappe framework that allows authenticated attackers to execute malicious scripts through weak HTML sanitization. This post covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2023-54409 Overview

CVE-2023-54409 is a cross-site scripting (XSS) vulnerability in the Frappe framework. The flaw resides in the html2text function, which weakly sanitizes user-supplied HTML input. Authenticated attackers can submit crafted HTML that bypasses sanitization and executes arbitrary JavaScript in the browsers of users viewing the rendered content. The vulnerability is tracked under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page. It affects Frappe versions before 13.46.1 and 14.x versions before 14.20.0.

Critical Impact

Authenticated attackers can inject persistent scripts that execute in other users' browser sessions, enabling session theft, account takeover, and actions performed on behalf of the victim.

Affected Products

  • Frappe framework versions prior to 13.46.1
  • Frappe framework 14.x versions prior to 14.20.0
  • Applications built on vulnerable Frappe releases, including ERPNext deployments

Discovery Timeline

  • 2026-10-12 - CVE-2023-54409 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2023-54409

Vulnerability Analysis

The vulnerability exists in Frappe's html2text helper function. This routine converts HTML content into text representation but applies insufficient sanitization to tags and attributes commonly used in XSS payloads. When authenticated users submit crafted HTML through fields processed by html2text, the function fails to neutralize script-bearing constructs before the content is rendered to other users.

The weakness falls under CWE-80, which addresses improper neutralization of script-related HTML tags. Exploitation requires an authenticated session, which limits exposure to users with legitimate access to data entry workflows. Rendered output executes in the browser context of any user who subsequently views the affected record, including administrators.

Root Cause

The html2text function performs string-based sanitization that does not fully account for obfuscated or variant HTML constructs. Attackers can leverage attribute-based event handlers, encoded payloads, or malformed tags to slip script content past the filter. Because the sanitized output is treated as safe for rendering, downstream templates emit the attacker-controlled markup without additional escaping.

Attack Vector

Exploitation requires network access to the Frappe application and valid authenticated credentials with permission to submit HTML content. An attacker crafts malicious HTML containing script payloads and submits it through a form, comment, or document field processed by html2text. When another user, such as a reviewer or administrator, opens the record, the stored payload executes in their browser session. The attack chain enables session cookie theft, cross-site request forgery against the authenticated session, and client-side actions performed under the victim's identity. Full technical details are available in the GitHub Security Advisory GHSA-wp7j-3w22-93j6 and the VulnCheck XSS Advisory.

Detection Methods for CVE-2023-54409

Indicators of Compromise

  • Document records containing <script>, onerror=, onload=, or javascript: constructs in fields normally processed by html2text
  • Unexpected outbound requests from authenticated user browser sessions to attacker-controlled domains
  • Session anomalies such as actions performed by administrator accounts shortly after viewing user-submitted records

Detection Strategies

  • Audit stored document content for HTML tags and event handler attributes that should not appear in normal business data
  • Review Frappe application logs for authenticated users submitting unusually large or malformed HTML payloads
  • Correlate web server access logs with document view events to identify suspicious client-side callbacks

Monitoring Recommendations

  • Enable Content Security Policy (CSP) violation reporting to surface inline script execution attempts
  • Monitor browser error telemetry for script errors originating from Frappe-rendered pages
  • Track account privilege changes and administrative actions following views of untrusted user content

How to Mitigate CVE-2023-54409

Immediate Actions Required

  • Upgrade Frappe to version 13.46.1 or later on the 13.x branch, or 14.20.0 or later on the 14.x branch
  • Review and sanitize existing stored documents for malicious HTML payloads submitted before patching
  • Restrict HTML submission permissions to trusted roles until the upgrade is complete

Patch Information

The Frappe project released fixed versions 13.46.1 and 14.20.0, which strengthen sanitization in the html2text function. Patch details and remediation guidance are published in the GitHub Security Advisory GHSA-wp7j-3w22-93j6.

Workarounds

  • Enforce a strict Content Security Policy that blocks inline scripts and restricts allowed script sources
  • Reduce the number of users with permission to submit HTML content in document fields
  • Apply server-side HTML sanitization using a hardened library such as bleach or DOMPurify before storing user-submitted content
bash
# Upgrade Frappe using bench to a patched release
bench update --reset
bench switch-to-branch version-14 frappe --upgrade
bench --site all migrate

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.