Skip to content

Commit dfd2918

Browse files
1 parent f72f83a commit dfd2918

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-4c2h-67qq-vm87",
4+
"modified": "2025-06-11T19:59:55Z",
5+
"published": "2025-06-11T19:59:54Z",
6+
"aliases": [],
7+
"summary": "Citizen skin vulnerable to stored XSS through multiple system messages",
8+
"details": "Various system messages are inserted by the Citizen skin in multiple places without proper sanitization.\n\n## 1 - Command Palette Tips\n\n### Summary\nMultiple system messages are inserted into the CommandPaletteFooter as raw HTML, allowing anybody who can edit those messages to insert arbitrary HTML into the DOM.\n\n### Details\nThe messages are retrieved using the `plain()` output mode: https://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/072e4365e9084e4b153eac62d3666566c06f5a49/resources/skins.citizen.commandPalette/components/CommandPaletteFooter.vue#L61-L66\n`currentTip` is set to one of these messages: https://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/072e4365e9084e4b153eac62d3666566c06f5a49/resources/skins.citizen.commandPalette/components/CommandPaletteFooter.vue#L69\n`currentTip` is inserted as raw HTML (`vue/no-v-html` should *not* be ignored here): https://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/072e4365e9084e4b153eac62d3666566c06f5a49/resources/skins.citizen.commandPalette/components/CommandPaletteFooter.vue#L3-L4\n\n### PoC\n1. Edit `citizen-command-palette-tip-commands`, `citizen-command-palette-tip-users`, `citizen-command-palette-tip-namespace` and `citizen-command-palette-tip-templates` to `<img src=\"\" onerror=\"alert(1)\">` (script tags don't work here due to the way the HTML is inserted)\n2. Open the command palette\n![image](https://github.com/user-attachments/assets/f07b238b-1ac1-4781-8d03-db755ba04546)\n\n### Impact\nThis impacts wikis where a group has the `editinterface` but not the `editsitejs` user right.\n\n## 2 - Menu Headings\n\n### Summary\nAll system messages in menu headings using the Menu.mustache template are inserted as raw HTML, allowing anybody who can edit those messages to insert arbitrary HTML into the DOM.\n\n### Details\nThe system messages for menu headings are inserted unescaped into raw HTML:\nhttps://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/072e4365e9084e4b153eac62d3666566c06f5a49/templates/Menu.mustache#L8-L10\n\n### PoC\n1. Go to any article using citizen with the `uselang` parameter set to `x-xss`\n2. A large number of alerts will be shown for various messages, e.g.:\n![image](https://github.com/user-attachments/assets/6a18ec77-d2a0-4a0d-b4aa-83359304659a)\n![image](https://github.com/user-attachments/assets/eaadb8e1-58b6-41be-90d2-829c50cf75ac)\n\nOn the main page of my test wiki, the following messages were shown: `navigation`, `notifications`, `user-interface-preferences`, `personaltools`, `variants`, `views`, `associated-pages`, `cactions` and `toolbox`.\n\n### Impact\nThis impacts wikis where a group has the `editinterface` but not the `editsitejs` user right.\n\n\n## 3 - User registration date\n\n### Summary\nVarious date messages returned by `Language::userDate` are inserted into raw HTML, allowing anybody who can edit those messages to insert arbitrary HTML into the DOM.\n\n### Details\nThe result of `$this->lang->userDate( $timestamp, $this->user )` returns unescaped values, but is inserted as raw HTML by Citizen:\nhttps://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/072e4365e9084e4b153eac62d3666566c06f5a49/includes/Components/CitizenComponentUserInfo.php#L55-L60\n\n### PoC\n1. Go to any page using citizen with the uselang parameter set to x-xss and while being logged in\nDepending on the registration date of the account you're logged in with, various messages can be shown. In my case, it's `november`:\n![image](https://github.com/user-attachments/assets/252a3453-99c8-4ce1-b6d6-a8485b7a9a43)\n\n\n### Impact\nThis impacts wikis where a group has the `editinterface` but not the `editsitejs` user right.\n\n\n## 4 - Preferences menu headings\n\n### Summary\nVarious preferences messages are inserted into raw HTML, allowing anybody who can edit those messages to insert arbitrary HTML into the DOM.\n\n### Details\nThe `innerHtml` of the label div is set to the `textContent` of the label, essentially unsanitizing the system messages:\nhttps://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/407052e7069bdeae927d6f1a2a1c9a45b473bf9a/resources/skins.citizen.preferences/addPortlet.polyfill.js#L18\n\n\n### PoC\n1. Edit `citizen-feature-custom-font-size-name` (or any other message displayed in a heading in the preferences menu) to `<img src=\"\" onerror=\"alert('citizen-feature-custom-font-size-name')\">` (script tags don't work here due to the way the HTML is inserted)\n2. Open the preferences menu\n![image](https://github.com/user-attachments/assets/b75f100d-09cc-443c-b635-e9d6ab48d133)\n\n\n\n## 5 - No results messages\n\n### Summary\nThe `citizen-search-noresults-title` and `citizen-search-noresults-desc` system messages are inserted into raw HTML, allowing anybody who can edit those messages to insert arbitrary HTML into the DOM.\n\n### Details\nThe system messages are inserted as raw HTML by the mustache template:\nhttps://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/407052e7069bdeae927d6f1a2a1c9a45b473bf9a/resources/skins.citizen.search/templates/TypeaheadPlaceholder.mustache#L8-L9\n\n\n### PoC\n1. Edit `citizen-search-noresults-title` and `citizen-search-noresults-desc` to `<img src=\"\" onerror=\"alert('citizen-search-noresults-title')\">` and `<img src=\"\" onerror=\"alert('citizen-search-noresults-desc')\">` (script tags don't work here due to the way the HTML is inserted)\n2. Open the search bar and search for a page that doesn't exist to get the \"no results\" messages to show up\n\n![image](https://github.com/user-attachments/assets/cf2963bc-5c86-4a4d-8574-de92d89d6d81)\n![image](https://github.com/user-attachments/assets/44839a7e-c08c-4df9-bd84-0f5863f64163)\n\n\n### Impact\nThis impacts wikis where a group has the `editinterface` but not the `editsitejs` user right.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Packagist",
19+
"name": "starcitizentools/citizen-skin"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "2.4.2"
27+
},
28+
{
29+
"fixed": "3.3.1"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/54c8717d45ce1594918f11cb9ce5d0ccd8dfee65"
44+
},
45+
{
46+
"type": "WEB",
47+
"url": "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/93c36ac778397e0e7c46cf7adb1e5d848265f1bd"
48+
},
49+
{
50+
"type": "PACKAGE",
51+
"url": "https://github.com/StarCitizenTools/mediawiki-skins-Citizen"
52+
}
53+
],
54+
"database_specific": {
55+
"cwe_ids": [
56+
"CWE-79"
57+
],
58+
"severity": "MODERATE",
59+
"github_reviewed": true,
60+
"github_reviewed_at": "2025-06-11T19:59:54Z",
61+
"nvd_published_at": null
62+
}
63+
}

0 commit comments

Comments
 (0)