XWiki Platform is a popular and versatile wiki platform that provides runtime services for applications built on top of it. However, recently, a critical security vulnerability (CVE-2022-29253) has been discovered in XWiki Platform, affecting versions 8.3-rc-1 up to 12.10.2. This vulnerability allows attackers to access any file located within the classloader by using the template API and a path that includes ".." in it, potentially leading to the exposure of sensitive information and malicious exploitation.

The vulnerability has been patched in XWiki Platform versions 14. and 13.10.3, so upgrading to these versions is highly recommended to ensure the security of your system. Unfortunately, there is no easy workaround for this issue.

Original References

1. CVE-2022-29253 - NIST National Vulnerability Database
2. XWiki Platform Security Advisory

Exploit Details

The vulnerability allows a potential attacker to access any file located within the classloader by manipulating the template API and a path that includes ".." in it. This could lead to sensitive information exposure, or in some cases, could lead to system compromise if an attacker successfully gains access to critical system files.

Here is a code snippet demonstrating the exploit

import org.xwiki.template.api.Template;
import org.xwiki.template.TemplateManager;

public class XWikiExploit {
  public static void main(String[] args) {
    TemplateManager templateManager = getTemplateManager(); // Assume implementation is done
    Template template = templateManager.getTemplate("path/../../path/to/classloader/file");
    System.out.println(template.getContent());
  }
}

In this example, the attacker can craft a specific path to the desired file within the classloader and pass it to templateManager.getTemplate() to access the file's content.

Solution

The best solution to address this vulnerability is to upgrade your XWiki Platform to the patched versions, i.e., version 14. or 13.10.3. You can download the latest version of XWiki Platform from the official download page.

If you cannot upgrade immediately, there is an option to manually apply the patch to your XWiki Platform, although this will be more complex and time-consuming. You can find the patch details and the corresponding Pull Request on the XWiki Platform Github repository here. Keep in mind that manually applying the patch may not address all potential security issues, and upgrading to the latest version is still the best solution.

Conclusion

XWiki Platform users should take immediate action to upgrade their systems to version 14. or 13.10.3 to protect themselves from the CVE-2022-29253 vulnerability. By doing so, you can ensure the security and stability of your XWiki Platform deployment and minimize the risk of information exposure and malicious exploitation.

Timeline

Published on: 05/25/2022 21:15:00 UTC
Last modified on: 06/07/2022 19:48:00 UTC