Skip to content

GHSA-pwfv-3cvg-9m4c CVE-2023-29507

org.xwiki.platform:xwiki-platform-oldcore makes Incorrect Use of Privileged APIs with DocumentAuthors

High Maven
Severity
9.1 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.90%
Chance of exploitation in the next 30 days. Higher than 59.64% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-648 Incorrect Use of Privileged APIs
Fix
14.10
Upgrade org.xwiki.platform:xwiki-platform-oldcore to this version or later

Description

Impact

The Document script API returns directly a DocumentAuthors allowing to set any authors to the document, which in consequence can allow subsequent executions of scripts since this author is used for checking rights. Example of such attack:

{{velocity}}
$doc.setContent('{{velocity}}$xcontext.context.authorReference{{/velocity}}')
$doc.authors.setContentAuthor('xwiki:XWiki.superadmin')
$doc.getRenderedContent()
{{/velocity}}

Patches

The problem has been patched in XWiki 14.10 and 14.4.7 by returning a safe script API.

Workarounds

There no easy workaround apart of upgrading.

References

For more information

If you have any questions or comments about this advisory:

Affected versions

Maven

PackageVulnerableFixed in
org.xwiki.platform:xwiki-platform-oldcore
>= 14.5, < 14.10
14.10
org.xwiki.platform:xwiki-platform-oldcore
>= 14.4.1, < 14.4.7
14.4.7

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

org.xwiki.platform:xwiki-platform-oldcore Maven → 14.10

maven
<dependency><groupId>org.xwiki.platform</groupId><artifactId>xwiki-platform-oldcore</artifactId><version>14.10</version></dependency>
gradle
implementation("org.xwiki.platform:xwiki-platform-oldcore:14.10")

Severity breakdown

CVSS 3.1 9.1

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

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

Weakness

CWE-648: Incorrect Use of Privileged APIs

The product does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.

How to prevent it
  • Implementation: Before calling privileged APIs, always ensure that the assumptions made by the privileged code hold true prior to making the call.
  • Architecture and Design: Know architecture and implementation weaknesses of the privileged APIs and make sure to account for these weaknesses before calling the privileged APIs to ensure that they can be called safely.
  • Implementation: If privileged APIs make certain assumptions about data, context or state validity that are passed by the caller, the calling code must ensure that these assumptions have been validated prior to making the call.
  • Implementation: If privileged APIs do not shed their privilege prior to returning to the calling code, then calling code needs to shed these privileges immediately and safely right after the call to the privileged APIs. In particular, the calling code needs to ensure that a privileged thread of execution will never be returned to the user or made available to user-controlled processes.
  • Implementation: Only call privileged APIs from safe, consistent and expected state.
  • Implementation: Ensure that a failure or an error will not leave a system in a state where privileges are not properly shed and privilege escalation is possible (i.e. fail securely with regards to handling of privileges).

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-qj4x-9g63-25g6
XWiki Platform Old Core: Resource path traversal via /skin/ action endpoint in Jetty 12+
High Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-mrqg-xmgm-rc5g
XWiki's REST APIs can list all pages/spaces, leading to unavailability
High Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-h259-74h5-4rh9
XWiki vulnerable to remote code execution with script right through unprotected Velocity scripting API
Critical Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-57q2-6cp4-9mq3
XWiki exposes passwords and emails stored in fields not named password/email in xml.vm
Medium Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-r38m-cgpg-qj69
XWiki leaks password hashes and other accessible password properties
Medium Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-p9qm-p942-q3w5
XWiki Platform vulnerable to SQL injection through XWiki#searchDocuments API
Critical Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-jp4x-w9cj-97q7
XWiki allows remote code execution through preview of XClass changes in AWM editor
High Also affects org.xwiki.platform:xwiki-platform-oldcore
GHSA-prwh-7838-xf82
XWiki allows SQL injection in query endpoint of REST API with Oracle
Critical Also affects org.xwiki.platform:xwiki-platform-oldcore
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor