CVE-2026-26028: CryptPad: Sanitizer Bypass in Diffmarked.js Allows Arbitrary HTML Injection and Potential XSS

Published May 20, 2026
·
Updated

Summary CryptPad’s HTML sanitizer in Diffmarked.js can be bypassed due to incomplete filtering of restricted tags. Because the sanitizer only validates the src attribute of <iframe> <video>, and <audio> elements, and does not restrict other attributes, an attacker can inject arbitrary HTML through srcdoc. This completely defeats CryptPad’s intended bounce sandboxing and allows link injection or other interactive content inside user-controlled documents.

Details The sanitizer defines forbidden and restricted tags but treats <iframe> as “restricted” instead of “forbidden”:

https://github.com/cryptpad/cryptpad/blob/0dd3c1f53d56dffb06651b86ead6b9b387920173/www/common/diffMarked.js#L403-L407 The actual enforcement only checks the src attribute, nothing else:

https://github.com/cryptpad/cryptpad/blob/0dd3c1f53d56dffb06651b86ead6b9b387920173/www/common/diffMarked.js#L445-L449

Because only src is validated, adding a benign blob: src but malicious srcdoc results in unrestricted rendering. PoC

An attacker can embed arbitrary HTML, including clickable external links, images, or interactive content, completely bypassing CryptPad’s bounce mechanism and sanitization:

html <iframe src=blob: srcdoc="<a href=https://attacker.com target=blank>CLICK ME</a>"></iframe>

Although CSP is strict, CryptPad exposes several same-origin gadgets that can execute attacker-controlled code.

For example, jscolor.js dynamically evaluates user-provided options: https://github.com/cryptpad/cryptpad/blob/0dd3c1f53d56dffb06651b86ead6b9b387920173/www/common/jscolor.js#L65-L71

Impact Sanitizer bypass, HTML injection and potentially XSS.

Other sources

CryptPad is an end-to-end encrypted collaborative office suite. In versions prior to 2026.2.0, the HTML sanitizer in Diffmarked.js can be bypassed due to incomplete attribute filtering on restricted tags. The sanitizer validates only the src attribute of <iframe>, <video>, and <audio> elements, leaving all other attributes unchecked. As a result, an attacker can inject arbitrary HTML through srcdoc, completely defeating CryptPad's intended bounce sandboxing and enabling link injection or other interactive content within user-controlled documents. The root cause lies in how the sanitizer classifies and enforces tag restrictions: although it defines both forbidden and restricted tag lists, <iframe> is treated as "restricted" rather than "forbidden." Enforcement then inspects only the src attribute, so pairing a benign blob: src with a malicious srcdoc results in unrestricted rendering. This issue has been fixed in version 2026.2.0.

NVD

Affected Software

2 affected components
CryptPad CryptPad<2026.2.0
npm/cryptpad<=5.9.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade CryptPad (Diffmarked.js sanitizer in diffMarked.js/jscolor.js) to a version that resolves this vulnerability.

    Fixed in 2026.2.0

Event History

May 20, 2026
CVE Published
via MITRE·06:51 PM
Data Sourced
via MITRE·06:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeakness
May 26, 2026
Advisory Published
via GitHub·07:05 PM
Data Sourced
via GitHub·07:05 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-26028?

CVE-2026-26028 is classified as a high-severity vulnerability due to its potential for arbitrary HTML injection leading to XSS attacks.

2

How do I fix CVE-2026-26028?

To fix CVE-2026-26028, upgrade your CryptPad installation to version 2026.2.0 or later.

3

What type of vulnerability is CVE-2026-26028?

CVE-2026-26028 is a sanitizer bypass vulnerability discovered in Diffmarked.js.

4

What versions of CryptPad are affected by CVE-2026-26028?

Versions of CryptPad prior to 2026.2.0 are affected by CVE-2026-26028.

5

What are the risks associated with CVE-2026-26028?

The risks include unauthorized execution of JavaScript due to cross-site scripting (XSS) attacks.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203