VYPR
Medium severity4.8NVD Advisory· Published Jun 18, 2026

TinaCMS rich-text (slatejson) rendering does not sanitize link/image URLs, allowing stored XSS via dangerous URL schemes

CVE-2026-55661

Description

TinaCMS rich-text parsing and the default link/image renderers did not sanitize the url field on Slate link/image nodes. Content containing javascript: or data:text/html URLs — including case-variant, whitespace-padded, and control-character-obfuscated forms — is rendered into href/src and executes when the content is viewed. Any actor able to author rich-text content (for example a lower-privileged editor, or imported/external content) can achieve stored XSS against editors and site viewers.

Fixed in https://github.com/tinacms/tinacms/pull/7056 via a sanitizeUrl() helper (case-insensitive, whitespace/control-character-normalized scheme allow-list) applied recursively to Slate trees at parse time and in the default rich-text rendering.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

1

Patches

Vulnerability mechanics

Root cause

"Missing sanitization of the `url` field on Slate link and image nodes allows `javascript:` and `data:text/html` URLs to be rendered into `href`/`src` attributes, enabling stored XSS."

Attack vector

An attacker who can author rich-text content (e.g., a lower-privileged editor or via imported/external content) can embed a link or image node with a `url` field containing `javascript:` or `data:text/html` — including case-variant, whitespace-padded, and control-character-obfuscated forms. When editors or site viewers view the content, the unsanitized URL is rendered into an `href` or `src` attribute, causing the malicious script to execute in the context of the TinaCMS admin or public site. This is a stored cross-site scripting (XSS) attack.

Affected code

The vulnerability resides in the rich-text parsing logic within `packages/@tinacms/mdx/src/parse/index.test.ts` and the default rich-text rendering code. The `sanitizeUrl()` helper is applied to Slate link (`a`) and image (`img`) nodes during slatejson parsing and in the render path. The patch also hardens message origin checks in `packages/tinacms/src/auth/authenticate.test.ts`, `packages/@tinacms/app/src/lib/preview-origin.test.ts`, and `packages/tinacms/src/react.test.tsx`, though those changes address separate trusted-boundary issues.

What the fix does

The patch introduces a `sanitizeUrl()` helper that performs a case-insensitive, whitespace/control-character-normalized scheme allow-list check. This helper is applied recursively to Slate trees during slatejson parsing (in `packages/@tinacms/mdx/src/parse/index.test.ts`) and also in the default rich-text rendering path as a defense-in-depth layer. Unsafe schemes like `javascript:` and `data:` are cleared to an empty string, while safe URLs (e.g., `https://`) remain unchanged. The patch also adds regression tests confirming that unsafe URLs on link and image nodes are sanitized, nested nodes are handled, and arbitrary non-slate props are left untouched.

Preconditions

  • authThe attacker must be able to create or import rich-text content containing Slate link or image nodes (e.g., as a lower-privileged editor or via external content ingestion).
  • configThe content must be rendered by TinaCMS's default rich-text renderer or parsed via the slatejson parser.

Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

3

News mentions

0

No linked articles in our index yet.