CVE-2025-32391: HedgeDoc allows XSS possibility through malicious SVG uploads
HedgeDoc is an open source, real-time, collaborative, markdown notes application. Prior to 1.10.3, a malicious SVG file uploaded to HedgeDoc results in the possibility of XSS when opened in a new tab instead of the editor itself. The XSS is possible by exploiting the JSONP capabilities of GitHub Gist embeddings. Only instances with the local filesystem upload backend or special configurations, where the uploads are served from the same domain as HedgeDoc, are vulnerable. This vulnerability is fixed in 1.10.3. When upgrading to HedgeDoc 1.10.3 is not possible, instance owners could add the following headers for all routes under /uploads as a first-countermeasure: Content-Disposition: attachment and Content-Security-Policy: default-src 'none'. Additionally, the external URLs in the script-src attribute of the Content-Security-Policy header should be removed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
HedgeDocto a version that resolves this vulnerability.Fixed in 1.10.3 - Configuration
Remove external URLs from the script-src attribute of the Content-Security-Policy header.
Content-Security-Policy script-src = Remove external URLs - Configuration
For all routes under /uploads, add the headers Content-Disposition: attachment and Content-Security-Policy: default-src 'none' as a countermeasure when upgrading to HedgeDoc 1.10.3 is not possible.
HedgeDoc uploads HTTP response headers for /uploads = Content-Disposition: attachment; Content-Security-Policy: default-src 'none'
Event History
Frequently Asked Questions
What is the severity of CVE-2025-32391?
CVE-2025-32391 is considered a high severity vulnerability due to the potential for Cross-Site Scripting (XSS) attacks.
How do I fix CVE-2025-32391?
To fix CVE-2025-32391, upgrade HedgeDoc to version 1.10.3 or later.
What type of vulnerability is CVE-2025-32391?
CVE-2025-32391 is a Cross-Site Scripting (XSS) vulnerability that can be exploited through malicious SVG files.
In which versions of HedgeDoc is CVE-2025-32391 present?
CVE-2025-32391 affects HedgeDoc versions prior to 1.10.3.
What can attackers do with CVE-2025-32391?
Attackers can exploit CVE-2025-32391 to execute arbitrary scripts in the context of a user's session when malicious SVG files are opened.