CVE-2026-25642
Unknown Unknown - Not Provided
Content-Security-Policy Bypass in HedgeDoc /uploads/ Enables Malicious SVG

Publication date: 2026-02-06

Last updated on: 2026-02-25

Assigner: GitHub, Inc.

Description
HedgeDoc is an open source, real-time, collaborative, markdown notes application. Prior to 1.10.6, files served below the /uploads/ endpoint did not use a more strict security-policy. This resulted in a too open Content-Security-Policy and furthermore opened the possibility to host malicious interactive web content (such as fake login forms) using SVG files. This vulnerability is fixed in 1.10.6.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-02-06
Last Modified
2026-02-25
Generated
2026-05-07
AI Q&A
2026-02-06
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
hedgedoc hedgedoc to 1.10.6 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 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.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

[{'type': 'paragraph', 'content': 'CVE-2026-25642 is a security vulnerability in HedgeDoc, a real-time collaborative markdown notes application. Before version 1.10.6, files served under the /uploads/ endpoint did not have strict enough Content-Security-Policy (CSP) headers. This overly permissive CSP allowed attackers to upload malicious interactive web content, such as SVG files containing fake login forms with embedded JavaScript. Because the CSP was too open, these malicious files could execute scripts or display deceptive content, potentially tricking users.'}, {'type': 'paragraph', 'content': "The root cause was that the Express framework's static file serving middleware (express.static) sent responses before the security headers could be applied, resulting in missing or ineffective CSP and Content-Disposition headers. The fix involved reordering middleware to set these headers before serving files and strengthening the CSP by adding the sandbox directive, which restricts script and plugin execution within uploaded files."}] [1, 3, 4]


How can this vulnerability impact me? :

This vulnerability can impact users by allowing attackers to upload malicious SVG files that contain interactive web content, such as fake login forms with embedded scripts. When users access these files, they could be deceived into submitting sensitive information or executing unwanted scripts, leading to potential phishing attacks or other malicious activities.

Because the files were served without proper security headers, browsers could execute scripts within these uploaded files, increasing the risk of client-side attacks. The vulnerability requires user interaction (e.g., clicking a link to the malicious file) but does not require any privileges or authentication.

The fix ensures that files are forced to be downloaded rather than displayed inline and that scripts or plugins within these files are sandboxed, mitigating the risk of malicious content execution.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

[{'type': 'paragraph', 'content': 'This vulnerability can be detected by checking the HTTP response headers for files served under the /uploads/ endpoint in HedgeDoc versions prior to 1.10.6. Specifically, you should verify if the Content-Security-Policy (CSP) header is missing the sandbox directive and if the Content-Disposition header is not set to attachment.'}, {'type': 'paragraph', 'content': 'You can use network inspection tools or command-line utilities like curl to inspect these headers.'}, {'type': 'list_item', 'content': 'Run a curl command to fetch headers for a file served under /uploads/: curl -I https://your-hedgedoc-instance/uploads/filename.svg'}, {'type': 'list_item', 'content': "Check the response headers for the presence of: Content-Security-Policy: default-src 'none'; sandbox and Content-Disposition: attachment"}, {'type': 'paragraph', 'content': 'If these headers are missing or the CSP header does not include the sandbox directive, the system is vulnerable.'}] [3, 4]


What immediate steps should I take to mitigate this vulnerability?

[{'type': 'paragraph', 'content': 'The primary mitigation is to upgrade HedgeDoc to version 1.10.6 or later, where the vulnerability is fixed by properly setting security headers on files served under the /uploads/ endpoint.'}, {'type': 'paragraph', 'content': 'If upgrading is not immediately feasible, you can configure a reverse proxy to add the following HTTP headers to all responses for the /uploads/ path:'}, {'type': 'list_item', 'content': 'Content-Disposition: attachment (forces files to be downloaded rather than displayed inline)'}, {'type': 'list_item', 'content': "Content-Security-Policy: default-src 'none'; sandbox (restricts loading of external resources and disallows script or plugin execution)"}, {'type': 'paragraph', 'content': 'These headers mitigate the risk of malicious interactive content being executed from uploaded files such as SVGs.'}] [3, 4, 1, 2]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart