This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-618f9d29-2a58-4ff9-bf8b-aa48d58eb790 XWIKI-23764 Open

One-Click RCE via "Force Edit" Parameter Bypass (CSRF Vector)

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-50dc471d-365e-42f8-a12a-d0b80dfaa2ee Łukasz Rybak created this issue on 26/Nov/25 12:10
 
Summary: One-Click RCE via "Force Edit" Parameter Bypass (CSRF Vector)
Issue Type: cid:jira-generated-image-avatar-618f9d29-2a58-4ff9-bf8b-aa48d58eb790 Bug
Affects Versions: 17.10.0
Assignee: Unassigned
Attachments: image-2025-11-26-11-51-10-157.png, image-2025-11-26-12-01-14-001.png, image-2025-11-26-12-04-50-352.png, image-2025-11-26-12-08-22-101.png, image-2025-11-26-12-08-40-763.png, image-2025-11-26-12-09-00-069.png, image-2025-11-26-12-09-11-621.png
Created: 26/Nov/25 12:10
Priority: cid:jira-generated-image-static-critical-910958f3-9dbe-43f9-9684-ab2b7567288b Critical
Reporter: Łukasz Rybak
Description:

Impact
The "Edit Warning" mechanism, designed to prevent Administrators from inadvertently executing malicious scripts created by lower-privileged users, can be completely bypassed via the HTTP GET parameter force=1.

This transforms a standard Privilege Escalation vulnerability into a One-Click Remote Code Execution (RCE) attack. An attacker can craft a malicious link (e.g., pointing to a trapped page) and send it to an Administrator. Upon clicking the link, the Administrator is forced directly into the editing context, triggering the execution of the malicious payload (Groovy script) immediately, without any warning or confirmation dialog.

Technical Analysis
Vulnerable Component: Wiki Editor / Lock Mechanism Vulnerable Parameter: force=1 Root Cause: The application logic accepts the force parameter in the URL to suppress the security warning about privilege elevation. This parameter is processed before rendering the page, causing the editor to load (and execute scripts) instantly with the current user's (Admin) privileges.

Proof of Concept
Step 1: Preparation (Attacker - Low Privileges)

1. Log in as a standard user.

2. Create a page/application (e.g., Stored_RCE).

Inject a Groovy Reverse Shell payload (report https://jira.xwiki.org/browse/XWIKI-23762) into the content. 44391_image-2025-11-26-12-01-14-001.png

3. Save the page.

Step 2: The Trap (Social Engineering)

4. The attacker crafts a link to the malicious page, appending ?force=1 to the Edit URL: http://localhost:8090/bin/edit/Stored_RCE?force=1

5. The attacker sends this link to an Administrator (e.g., via email, chat, or a comment on another page: "Can you please check this page? It creates an error in the editor").

Step 3: Execution (Victim - Administrator)

6. The Administrator clicks the link.
44389_image-2025-11-26-12-08-22-101.png

7. The "Restricted Edit" warning page is skipped.

8. The Editor loads immediately. The XWiki rendering engine processes the groovy macro using the Administrator's Programming Rights.

44388_image-2025-11-26-12-08-40-763.png

8. The Reverse Shell is executed, and the attacker gains root access.

44386_image-2025-11-26-12-09-11-621.png

The attached screenshot confirms that accessing the URL with ?force=1 loads the editor directly (bypassing the warning) while simultaneously executing the payload.

Patches
The force parameter should not be accepted via GET request for privilege escalation warnings, or it should require a valid CSRF token that cannot be predicted by the attacker. Alternatively, executing scripts in Edit mode should be strictly disabled regardless of the "force" parameter.

Attribution
Reported by: Łukasz Rybak GitHub: https://github.com/lukasz-rybak