Skip to content

GHSA-m5m2-h6h9-p2c8 CVE-2023-41046

Velocity execution without script right through VelocityCode and VelocityWiki property

Medium Maven
Severity
6.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.55%
Chance of exploitation in the next 30 days. Higher than 45.79% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-862 Missing Authorization
Fix
14.10.10
Upgrade org.xwiki.platform:xwiki-platform-oldcore to this version or later

Description

Impact

It is possible in XWiki to execute Velocity code without having script right by creating an XClass with a property of type "TextArea" and content type "VelocityCode" or "VelocityWiki". For the former, the syntax of the document needs to be set the xwiki/1.0 (this syntax doesn't need to be installed). In both cases, when adding the property to an object, the Velocity code is executed regardless of the rights of the author of the property (edit right is still required, though). In both cases, the code is executed with the correct context author so no privileged APIs can be accessed. However, Velocity still grants access to otherwise inaccessible data and APIs that could allow further privilege escalation.

At least for "VelocityCode", this behavior is most likely very old but only since XWiki 7.2, script right is a separate right, before that version all users were allowed to execute Velocity and thus this was expected and not a security issue.

Patches

This has been patched in XWiki 14.10.10 and 15.4 RC1.

Workarounds

There are no known workarounds.

References

Affected versions

Maven

PackageVulnerableFixed in
org.xwiki.platform:xwiki-platform-oldcore
>= 7.2, < 14.10.10
14.10.10
org.xwiki.platform:xwiki-platform-oldcore
>= 15.0-rc-1, < 15.4-rc-1
15.4-rc-1

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.10

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

Severity breakdown

CVSS 3.1 6.3

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

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

Weakness

CWE-862: Missing Authorization

The product does not perform an authorization check when an actor attempts to access a resource or perform an action.

How to prevent it
  • Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • Architecture and Design: Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
  • Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
  • Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
  • System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.

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