{"id":"CVE-2026-26028","aliases":["CVE-2026-26028","GHSA-g2g4-47gv-p72v"],"related":[],"kind":"vulnerability","state":"published","title":"CryptPad: Sanitizer Bypass in Diffmarked.js Allows Arbitrary HTML Injection and Potential XSS","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nCryptPad’s HTML sanitizer in Diffmarked.js can be bypassed due to incomplete filtering of restricted tags.\nBecause 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.\n\n### Details\nThe sanitizer defines forbidden and restricted tags but treats <iframe> as “restricted” instead of “forbidden”:\n\nhttps://github.com/cryptpad/cryptpad/blob/0dd3c1f53d56dffb06651b86ead6b9b387920173/www/common/diffMarked.js#L403-L407\nThe actual enforcement only checks the src attribute, nothing else:\n\nhttps://github.com/cryptpad/cryptpad/blob/0dd3c1f53d56dffb06651b86ead6b9b387920173/www/common/diffMarked.js#L445-L449\n\nBecause only src is validated, adding a benign blob: src but malicious srcdoc results in unrestricted rendering.\n### PoC\n\nAn attacker can embed arbitrary HTML, including clickable external links, images, or interactive content, completely bypassing CryptPad’s bounce mechanism and sanitization:\n\n```html\n<iframe src=blob: srcdoc=\"<a href=https://attacker.com target=_blank>CLICK ME</a>\"></iframe>\n```\n\nAlthough CSP is strict, CryptPad exposes several same-origin gadgets that can execute attacker-controlled code.\n\nFor example, `jscolor.js` dynamically evaluates user-provided options:\nhttps://github.com/cryptpad/cryptpad/blob/0dd3c1f53d56dffb06651b86ead6b9b387920173/www/common/jscolor.js#L65-L71\n\n### Impact\nSanitizer bypass, HTML injection and potentially XSS.","format":"markdown","source":"ghsa"},{"lang":"es","text":"CryptPad es una suite ofimática colaborativa cifrada de extremo a extremo. En versiones anteriores a la 2026.2.0, el saneador de HTML en Diffmarked.js puede ser eludido debido a un filtrado incompleto de atributos en etiquetas restringidas. El saneador valida solo el atributo src de los elementos <iframe>, <video> y <audio>, dejando todos los demás atributos sin verificar. Como resultado, un atacante puede inyectar HTML arbitrario a través de srcdoc, anulando por completo el sandboxing de rebote previsto de CryptPad y permitiendo la inyección de enlaces u otro contenido interactivo dentro de documentos controlados por el usuario. La causa raíz reside en cómo el saneador clasifica y aplica las restricciones de etiquetas: aunque define listas de etiquetas prohibidas y restringidas, <iframe> es tratado como 'restringido' en lugar de 'prohibido'. La aplicación luego inspecciona solo el atributo src, por lo que emparejar un src benigno de tipo blob: con un srcdoc malicioso resulta en una renderización sin restricciones. Este problema ha sido solucionado en la versión 2026.2.0.","source":"nvd"}],"published":"2026-05-20T18:51:43.643Z","modified":"2026-07-23T12:10:00.110Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-116"],"affected":[{"ranges":[{"version":"< 2026.2.0","status":"affected"}],"vendor":"cryptpad","product":"cryptpad","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"5.9.0"}],"ecosystem":"npm","package":"cryptpad","purl":"pkg:npm/cryptpad","source":"ghsa"}],"references":[{"url":"https://github.com/cryptpad/cryptpad/security/advisories/GHSA-g2g4-47gv-p72v","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/cryptpad/cryptpad/releases/tag/2026.2.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26028","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/cryptpad/cryptpad","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-20T19:31:12.220Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-26028","url":"https://www.cve.org/CVERecord?id=CVE-2026-26028","licence":"CVE Terms of Use","modified":"2026-05-20T19:33:12.902Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g2g4-47gv-p72v","url":"https://github.com/advisories/GHSA-g2g4-47gv-p72v","licence":"CC-BY-4.0","modified":"2026-06-09T05:15:08.331Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-26028","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26028","licence":"Public domain","modified":"2026-07-23T12:10:00.110Z"}],"updatedAt":"2026-11-25T22:59:22.059Z","epss":{"score":0.00285,"percentile":0.13727,"date":"2026-11-30T12:00:22.000Z"}}