Skip to content

XWiki Platform privilege escalation (PR) from account through AWM content fields

Critical severity GitHub Reviewed Published Aug 21, 2023 in xwiki/xwiki-platform • Updated Nov 8, 2023

Package

maven org.xwiki.platform:xwiki-platform-appwithinminutes-ui (Maven)

Affected versions

>= 4.3-milestone-2, < 14.10.5

Patched versions

14.10.5

Description

Impact

Any registered user can use the content field of their user profile page to execute arbitrary scripts with programming rights, thus effectively performing rights escalation.

The problem is present since version 4.3M2 when AppWithinMinutes Application added support for the Content field, allowing any wiki page (including the user profile page) to use its content as an AWM Content field, which has a custom displayer that executes the content with the rights of the AppWithinMinutes.Content author, rather than the rights of the content author.

Patches

The issue has been fixed in XWiki 14.10.5 and 15.1RC1 by xwiki/xwiki-platform@dfb1cde . The fix is in the content of the AppWithinMinutes.Content page that defines the custom displayer. By using the display script service to render the content we make sure that the proper author is used for access rights checks.

Workarounds

If you want to fix this problem on older versions of XWiki that have not been patched then you need to modify the content of AppWithinMinutes.Content page to use the display script service to render the content, like this:

- {{html}}$tdoc.getRenderedContent($tdoc.content, $tdoc.syntax.toIdString()).replace('{{', '&amp;#123;&amp;#123;'){{/html}}
+ {{html}}$services.display.content($tdoc, {
+   'displayerHint': 'default'
+ }).replace('{{/html}}', '&amp;#123;&amp;#123;/html&amp;#125;&amp;#125;'){{/html}}

References

For more information

If you have any questions or comments about this advisory:

Attribution

This vulnerability has been found and reported by @michitux .

References

@mflorea mflorea published to xwiki/xwiki-platform Aug 21, 2023
Published to the GitHub Advisory Database Aug 21, 2023
Reviewed Aug 21, 2023
Published by the National Vulnerability Database Aug 23, 2023
Last updated Nov 8, 2023

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L

EPSS score

0.108%
(45th percentile)

Weaknesses

CVE ID

CVE-2023-40177

GHSA ID

GHSA-5mf8-v43w-mfxp

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.