Skip to main content

CVE-2022-24897: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in xwiki xwiki-commons

Medium
Published: Mon May 02 2022 (05/02/2022, 21:49:17 UTC)
Source: CVE
Vendor/Project: xwiki
Product: xwiki-commons

Description

APIs to evaluate content with Velocity is a package for APIs to evaluate content with Velocity. Starting with version 2.3 and prior to 12.6.7, 12.10.3, and 13.0, the velocity scripts are not properly sandboxed against using the Java File API to perform read or write operations on the filesystem. Writing an attacking script in Velocity requires the Script rights in XWiki so not all users can use it, and it also requires finding an XWiki API which returns a File. The problem has been patched in versions 12.6.7, 12.10.3, and 13.0. There is no easy workaround for fixing this vulnerability other than upgrading and being careful when giving Script rights.

AI-Powered Analysis

AILast updated: 06/22/2025, 01:50:22 UTC

Technical Analysis

CVE-2022-24897 is a path traversal vulnerability affecting the xwiki-commons component of the XWiki platform, specifically in the APIs that evaluate content using Velocity scripts. The vulnerability arises because Velocity scripts are not properly sandboxed against the Java File API, allowing scripts with sufficient privileges to perform unauthorized read or write operations on the filesystem. This improper limitation of pathname to a restricted directory (CWE-22) enables an attacker with Script rights in XWiki to craft malicious Velocity scripts that exploit the vulnerability. However, exploitation requires two conditions: the attacker must have Script rights within XWiki, and must find an XWiki API that returns a File object, which can then be manipulated to access arbitrary filesystem paths. The vulnerability affects versions starting from 2.3 up to but not including 12.6.7, and also versions 12.7-rc-1 up to but not including 12.10.3. The issue has been patched in versions 12.6.7, 12.10.3, and 13.0. There is no straightforward workaround other than upgrading to a patched version and exercising caution when assigning Script rights to users. No known exploits have been reported in the wild, indicating limited active exploitation. The vulnerability primarily impacts confidentiality and integrity by potentially allowing unauthorized file access or modification, but exploitation requires authenticated access with elevated scripting privileges, limiting the attack surface.

Potential Impact

For European organizations using vulnerable versions of XWiki, this vulnerability poses a moderate risk. If an attacker gains Script rights, they could read sensitive files or modify critical configuration or content files, potentially leading to data leakage, defacement, or further compromise of the system. Given that XWiki is often used for collaborative documentation and knowledge management in enterprises, unauthorized access to internal documents or configuration files could expose intellectual property or sensitive operational information. The requirement for Script rights and the need to locate specific APIs returning File objects reduce the likelihood of widespread exploitation but do not eliminate the risk, especially in environments with lax access controls. Organizations in sectors with stringent data protection requirements (e.g., finance, healthcare, government) could face compliance issues if sensitive data is exposed. Additionally, unauthorized file writes could disrupt availability or integrity of the wiki platform, impacting business continuity. The absence of known exploits suggests limited active threat but does not preclude targeted attacks.

Mitigation Recommendations

1. Upgrade affected XWiki instances to versions 12.6.7, 12.10.3, 13.0, or later where the vulnerability is patched. 2. Audit and restrict Script rights rigorously, granting them only to trusted users who require scripting capabilities. 3. Review and harden access controls on APIs that expose File objects to minimize exposure. 4. Implement monitoring and alerting for unusual scripting activity or file access patterns within XWiki. 5. Conduct regular security assessments and code reviews of custom Velocity scripts to ensure they do not inadvertently expose filesystem access. 6. If immediate upgrade is not feasible, consider isolating XWiki instances in segmented network zones with limited access and enforce strict authentication and authorization policies. 7. Educate administrators and users about the risks of granting Script rights and the importance of patching. These steps go beyond generic advice by focusing on privilege management, API exposure, and operational monitoring specific to the vulnerability context.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-02-10T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9848c4522896dcbf64ad

Added to database: 5/21/2025, 9:09:28 AM

Last enriched: 6/22/2025, 1:50:22 AM

Last updated: 7/31/2025, 10:52:56 PM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats