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

> Attackers can inject arbitrary HTML and execute scripts in CryptPad documents by bypassing the Diffmarked.js sanitizer, compromising user sessions and data.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 20 May 2026
- **Updated:** 20 May 2026
- **Also known as:** GHSA-g2g4-47gv-p72v

## What is CVE-2026-26028?

CVE-2026-26028 is a medium-severity cross-site scripting vulnerability in cryptpad, published on 20 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2026-26028?

2 open source packages ship an affected version, including cryptpad.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cryptpad` | npm | All versions to 5.9.0 | None |
| `cryptpad` | npm | All versions to 5.9.0 | None |

## How do I fix CVE-2026-26028?

No fix has been published for CVE-2026-26028 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-26028 being exploited?

There is no known exploitation of CVE-2026-26028 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-26028 and fix it if it is affected.

What it is: CVE-2026-26028 is a medium-severity cross-site scripting vulnerability in cryptpad, published on 20 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-26028 in the wild and no public exploit code.

Affected packages and fixed versions:
- cryptpad (npm): affected all versions up to 5.9.0; no fix listed
- cryptpad (npm): affected all versions up to 5.9.0; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-26028/ (Markdown: https://insights.sbomify.com/CVE-2026-26028/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-26028
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-26028
- OSV: https://osv.dev/vulnerability/CVE-2026-26028

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-26028/
Summaries are generated and may contain mistakes; the official description above is the record.
