/

CVE-2025-53837

Severity:

CRITICAL RISK

(9.9)

Code Injection (CWE-95) in the XWiki Rendering Engine

CVE-2025-53837

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

Impact:

Remote Code Execution and Unauthorized Wiki Content Access

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

XWiki Rendering contains a code injection vulnerability that can let an authenticated user with document-editing access execute script macros, including Groovy or Python, with programming rights. When rendered content is embedded in an HTML macro without adequate escaping, a user may escape the intended context and cause arbitrary code execution affecting wiki contents.

Affected context

The vulnerability occurs in XWiki deployments where users can edit their own profiles or other wiki documents and their content is processed by the rendering system. Risk is highest when rendered output is inserted into HTML macros without context-preserving escaping, allowing user-controlled content to influence subsequent macro interpretation.

Exploit preconditions

  • Attack surface: Editable XWiki documents or user profiles processed by the rendering engine
  • Required access: Authenticated permission to edit an applicable document or profile
  • Trigger point: Rendering of attacker-controlled content inside an HTML macro
  • Why exploitation is possible: Insufficient escaping allows rendered output to terminate the surrounding HTML macro and introduce script macros that execute with programming rights

Why this happens

The underlying flaw is improper neutralization of directives in dynamically evaluated content, mapping to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'). Rendering output is treated as safe HTML macro content without preserving the intended parsing boundary, so user-controlled text can alter the structure and cause embedded scripting constructs to be evaluated with elevated execution privileges.

Potential impact

  • An attacker may execute arbitrary code on the XWiki server
  • An attacker could read, modify, or delete wiki contents
  • Confidential documents and stored data may be exposed
  • Wiki integrity could be compromised through unauthorized content changes
  • Server accounts, credentials, or connected services may be at risk
  • The vulnerability could enable broader compromise depending on process privileges and deployment configuration

General mitigation guidance

Mitigation generally focuses on maintaining strict separation between rendered content and executable macro contexts.

Common defensive patterns include:

  • Apply context-aware escaping to all rendering output inserted into HTML or other macro bodies
  • Ensure rendered content cannot terminate or alter its surrounding macro structure
  • Restrict script macro availability and programming privileges according to user roles
  • Use least-privilege permissions for the XWiki process and its integrations
  • Treat user-editable profiles and documents as untrusted input
  • Prefer secure-by-default rendering and macro policies that disable executable constructs unless explicitly required
  • Add regression tests covering nested macros, output boundaries, and encoding transitions
  • Apply the vendor's security fixes through the organization's normal patch-management process

How teams detect issues like this

Detection can combine source analysis, runtime monitoring, and policy enforcement:

  • Use static analysis to identify rendered output inserted into HTML or executable macro contexts without context-aware escaping
  • Review code paths that concatenate or re-embed parser output into macro bodies
  • Flag document-rendering features that permit user-controlled content to reach script or programming macros
  • Monitor audit logs for unexpected edits to profiles or documents followed by privileged macro execution
  • Enforce policies limiting programming macros to trusted administrators and approved spaces
  • Add automated tests and security-focused code review checks for parser-boundary violations and output-context changes

Sources

SourceLink
github.comgithub.com/xwiki/xwiki-rendering/commit/92bc8095ed3acce15ab200c8525e1623b4898be5
github.comgithub.com/xwiki/xwiki-rendering/releases/tag/xwiki-rendering-14.10.2
github.comgithub.com/xwiki/xwiki-rendering/releases/tag/xwiki-rendering-15.0-rc-1
github.comgithub.com/xwiki/xwiki-rendering/security/advisories/GHSA-26vp-8gxg-v4pg
jira.xwiki.orgjira.xwiki.org/browse/XRENDERING-693
jira.xwiki.orgjira.xwiki.org/browse/XWIKI-20313
jira.xwiki.orgjira.xwiki.org/browse/XWIKI-20327

Frequently asked

questions

An authenticated user generally needs permission to edit their own profile or another document that is processed by the vulnerable rendering path. The practical scope depends on XWiki permissions and macro policies.

No. The attack can originate through the XWiki document-editing interface when a user has sufficient editing privileges. Server-side code execution occurs when the affected content is rendered.

Preserve rendering boundaries with context-aware escaping so output cannot close its containing HTML macro or introduce executable macro content. Script and programming privileges should also be restricted.

Treat all editable wiki content as untrusted, enforce secure-by-default macro policies, apply least privilege, and test every transition between markup, rendered output, and executable contexts.

Find out what's already
exploitable in your codebase.