{"id":"CVE-2022-36098","aliases":["CVE-2022-36098","GHSA-c5v8-2q4r-5w9v"],"related":[],"kind":"vulnerability","state":"published","title":"XWiki Platform Mentions UI vulnerable to Cross-site Scripting","summary":"XWiki Platform Mentions UI is a user interface for mentioning users in wiki content for XWiki Platform, a generic wiki platform. Starting in version 12.5-rc-1 and prior to versions 13.10.6 and 14.4, it's possible to store Javascript or groovy scripts in a mention, macro anchor, or reference field. The stored code is executed by anyone visiting the page with the mention. This issue has been patched on XWiki 14.4 and 13.10.6. As a workaround, one may update `XWiki.Mentions.MentionsMacro` and edit the `Macro code` field of the `XWiki.WikiMacroClass` XObject.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"XWiki Platform Mentions UI is a user interface for mentioning users in wiki content for XWiki Platform, a generic wiki platform. Starting in version 12.5-rc-1 and prior to versions 13.10.6 and 14.4, it's possible to store Javascript or groovy scripts in a mention, macro anchor, or reference field. The stored code is executed by anyone visiting the page with the mention. This issue has been patched on XWiki 14.4 and 13.10.6. As a workaround, one may update `XWiki.Mentions.MentionsMacro` and edit the `Macro code` field of the `XWiki.WikiMacroClass` XObject.","source":"cvelist"},{"lang":"en","text":"### Impact\nIt's possible to store Javascript or groovy scripts in an mention macro anchor or reference field. The stored code is executed by anyone visiting the page with the mention.\n\nFor example, the example below will create a file at `/tmp/exploit.txt`:\n\n```\n{{mention reference=\"XWiki.Translation\" anchor=\"{{/html~}~}{{async async=~\"true~\" cached=~\"false~\" context=~\"doc.reference~\"~}~}{{groovy~}~}new File(~\"/tmp/exploit.txt~\").withWriter { out -> out.println(~\"owned!~\"); }{{/groovy~}~}{{/async~}~}\"/}}\n```\n\n### Patches\nThis issue has been patched on XWiki 14.4 and 13.10.6.\n\n### Workarounds\nIt's possible to fix the vulnerability by updating `XWiki.Mentions.MentionsMacro` and edit the `Macro code` field of the `XWiki.WikiMacroClass` XObject.\n\n```velocity\n<a id=\"$anchor\" class=\"$stringtool.join($cssClasses, ' ')\" data-reference=\"$services.model.serialize($reference.reference, 'default')\" href=\"$link\">$content</a>\n```\n\nMust be replaced by \n\n```velocity\n<a id=\"$escapetool.xml($anchor)\" class=\"$stringtool.join($cssClasses, ' ')\" data-reference=\"$escapetool.xml($services.model.serialize($reference.reference, 'default'))\" href=\"$escapetool.xml($link)\">\n  $escapetool.xml($content)\n</a>\n```\n\nSee the patches:\n- 14.4: https://github.com/xwiki/xwiki-platform/commit/4f290d87a8355e967378a1ed6aee23a06ba162eb\n- 13.10.6: https://github.com/xwiki/xwiki-platform/commit/4032dc896857597efd169966dc9e2752a9fdd459#diff-4fe22885f772e47d3561a05348f73921669ec12d4413b220383b73c7ae484bc4R608-R610\n\n### References\n\n- https://jira.xwiki.org/browse/XWIKI-19752\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n- Open an issue in [Jira XWiki.org](https://jira.xwiki.org/)\n- Email us at [Security Mailing List](mailto:security@xwiki.org)","format":"markdown","source":"ghsa"},{"lang":"es","text":"XWiki Platform Mentions UI es una Interfaz de Usuario para mencionar usuarios en contenido wiki para XWiki Platform, una plataforma wiki genérica.&#xa0;A partir de la versión 12.5-rc-1 y anteriores a 13.10.6 y 14.4, es posible almacenar Javascript o scripts maravillosos en un campo de mención, ancla de macro o referencia.&#xa0;El código almacenado es ejecutado por cualquiera que visite la página con la mención.&#xa0;Este problema ha sido parcheado en XWiki versiones 14.4 y 13.10.6.&#xa0;Como mitigación, puede actualizarse \"XWiki.Mentions.MentionsMacro\" y editar el campo \"Macro code\" del XObject \"XWiki.WikiMacroClass\"","source":"nvd"}],"published":"2022-09-08T20:50:11.000Z","modified":"2026-06-17T04:52:54.967Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L","score":8.9,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L","score":8.9,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":9,"rating":"CRITICAL"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 12.5-rc-1, < 13.10.6","status":"affected"},{"version":">= 14.0, < 14.4","status":"affected"}],"vendor":"xwiki","product":"xwiki-platform","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"12.5-rc-1","status":"affected","fixed":"13.10.6"}],"ecosystem":"Maven","package":"org.xwiki.platform:xwiki-platform-mentions-ui","purl":"pkg:maven/org.xwiki.platform/xwiki-platform-mentions-ui","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"14.0","status":"affected","fixed":"14.4"}],"ecosystem":"Maven","package":"org.xwiki.platform:xwiki-platform-mentions-ui","purl":"pkg:maven/org.xwiki.platform/xwiki-platform-mentions-ui","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"12.5","fixed":"13.10.6"},{"status":"affected","introduced":"14.0","fixed":"14.4"}],"vendor":"xwiki","product":"xwiki","cpe":"cpe:2.3:a:xwiki:xwiki:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-c5v8-2q4r-5w9v","tags":["exploit","patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xwiki/xwiki-platform/commit/4032dc896857597efd169966dc9e2752a9fdd459#diff-4fe22885f772e47d3561a05348f73921669ec12d4413b220383b73c7ae484bc4R608-R610","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xwiki/xwiki-platform/commit/4f290d87a8355e967378a1ed6aee23a06ba162eb","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://jira.xwiki.org/browse/XWIKI-19752","tags":["exploit","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-36098","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/xwiki/xwiki-platform","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-04-22T15:41:45.397Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-36098","url":"https://www.cve.org/CVERecord?id=CVE-2022-36098","licence":"CVE Terms of Use","modified":"2025-04-22T17:22:36.540Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c5v8-2q4r-5w9v","url":"https://github.com/advisories/GHSA-c5v8-2q4r-5w9v","licence":"CC-BY-4.0","modified":"2023-11-08T04:10:00.925Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-36098","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-36098","licence":"Public domain","modified":"2026-06-17T04:52:54.967Z"}],"updatedAt":"2026-11-25T22:58:14.781Z","epss":{"score":0.72286,"percentile":0.99443,"date":"2026-12-01T12:00:22.000Z"}}