Skip to main content

CVE-2025-49581: CWE-94: Improper Control of Generation of Code ('Code Injection') in xwiki xwiki-platform

High
VulnerabilityCVE-2025-49581cvecve-2025-49581cwe-94cwe-270cwe-250
Published: Fri Jun 13 2025 (06/13/2025, 16:09:22 UTC)
Source: CVE Database V5
Vendor/Project: xwiki
Product: xwiki-platform

Description

XWiki is a generic wiki platform. Any user with edit right on a page (could be the user's profile) can execute code (Groovy, Python, Velocity) with programming right by defining a wiki macro. This allows full access to the whole XWiki installation. The main problem is that if a wiki macro parameter allows wiki syntax, its default value is executed with the rights of the author of the document where it is used. This can be exploited by overriding a macro like the children macro that is used in a page that has programming right like the page XWiki.ChildrenMacro and thus allows arbitrary script macros. This vulnerability has been patched in XWiki 16.4.7, 16.10.3 and 17.0.0 by executing wiki parameters with the rights of the wiki macro's author when the parameter's value is the default value.

AI-Powered Analysis

AILast updated: 06/13/2025, 16:34:32 UTC

Technical Analysis

CVE-2025-49581 is a high-severity code injection vulnerability affecting multiple versions of the XWiki platform, a widely used generic wiki software. The vulnerability arises from improper control over the generation and execution of code within wiki macros. Specifically, any user with edit rights on a page can define or override a wiki macro parameter that allows wiki syntax, which by default executes with the rights of the author of the document where the macro is used. This behavior enables an attacker to execute arbitrary code (Groovy, Python, Velocity scripts) with elevated programming rights if the macro is used on a page with programming rights, such as the XWiki.ChildrenMacro page. The core issue is that default parameter values are executed with the document author's privileges rather than the macro author's, allowing privilege escalation and arbitrary script execution. This can lead to full compromise of the XWiki installation, including unauthorized data access, modification, and potential lateral movement within the environment. The vulnerability affects versions from 11.10.11 up to but not including 12.0, 12.6.3 up to but not including 12.7, 12.8-rc-1 up to but not including 16.4.7, 16.5.0-rc-1 up to but not including 16.10.3, and 17.0.0-rc-1 up to but not including 17.0.0. The issue was patched in versions 16.4.7, 16.10.3, and 17.0.0 by changing the execution context of wiki macro parameters to the macro author's rights when default values are used. The CVSS 4.0 base score is 8.7 (high), reflecting network exploitability without authentication, low attack complexity, and significant impact on confidentiality, integrity, and availability. No known exploits are reported in the wild yet, but the vulnerability's nature and ease of exploitation make it a critical concern for affected deployments.

Potential Impact

For European organizations using vulnerable versions of XWiki, this vulnerability poses a significant risk of full system compromise. Attackers can leverage the code injection flaw to execute arbitrary scripts with elevated privileges, potentially leading to unauthorized data disclosure, data tampering, or destruction. Given XWiki's use in collaborative environments, including knowledge management, documentation, and intranet portals, exploitation could disrupt business operations, leak sensitive corporate or personal data, and facilitate further attacks within the network. The ability to execute code remotely without authentication and user interaction increases the likelihood of automated exploitation attempts. Organizations in sectors with strict data protection regulations, such as finance, healthcare, and government, face heightened compliance risks and reputational damage if exploited. Additionally, the vulnerability could be used as a foothold for ransomware deployment or lateral movement in enterprise networks. The absence of known exploits currently provides a window for proactive mitigation, but the high severity and ease of exploitation necessitate urgent action.

Mitigation Recommendations

1. Immediate upgrade to patched versions of XWiki: 16.4.7, 16.10.3, or 17.0.0 to ensure the vulnerability is remediated. 2. Until patching is possible, restrict edit rights on wiki pages to trusted users only, minimizing the risk of malicious macro creation or modification. 3. Audit existing wiki macros, especially those with programming rights, to identify and remove or secure any macros that accept parameters with wiki syntax or default values that could be exploited. 4. Implement strict access controls and monitoring on the XWiki platform, including logging macro usage and changes to pages with elevated privileges. 5. Employ web application firewalls (WAFs) with custom rules to detect and block suspicious macro-related payloads or script execution attempts. 6. Conduct regular security reviews and penetration testing focused on wiki macro functionality to detect any residual or related vulnerabilities. 7. Educate users with edit rights about the risks of macro misuse and enforce policies limiting the use of scripting capabilities within the wiki. 8. Isolate the XWiki installation within a segmented network zone to limit potential lateral movement if compromised.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-06-06T15:44:21.555Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 684c4f8ca8c921274380ac94

Added to database: 6/13/2025, 4:19:24 PM

Last enriched: 6/13/2025, 4:34:32 PM

Last updated: 8/16/2025, 1:05:50 AM

Views: 25

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