The vulnerability allows for privilege escalation when a user with edit rights creates a page with a script (e.g., in an XObject) and a link, and subsequently, a higher-privileged user (e.g., an admin) renames or moves the target of that link. The refactoring operation, specifically when saving the page whose links were updated, incorrectly set the author of this page to the user performing the refactoring.
The core issue resided in the org.xwiki.refactoring.internal.DefaultReferenceUpdater.saveDocumentPreservingContentAuthor method. Before the patch, this method used document.setAuthorReference(xcontext.getUserReference()); to set the document's author. This action changed the effective author for rights evaluation to the user performing the refactor. If this user had higher privileges than the original content creator, any scripts on the page would then execute with these elevated privileges.
The patch addresses this by renaming saveDocumentPreservingContentAuthor to saveDocumentPreservingAuthors and changing its logic. Instead of setting the main authorReference, it now sets document.getAuthors().setOriginalMetadataAuthor(...). According to the advisory, this originalMetadataAuthor is used for history/auditing purposes and does not affect the rights evaluation for script execution, which continues to use the original content author. The renameLinks function calls this save method and is therefore part of the vulnerable workflow.
During exploitation, a profiler would likely show org.xwiki.refactoring.internal.DefaultReferenceUpdater.update (or updateRelativeLinks), which calls org.xwiki.refactoring.internal.DefaultReferenceUpdater.renameLinks, which in turn (before the patch) called the vulnerable version of org.xwiki.refactoring.internal.DefaultReferenceUpdater.saveDocumentPreservingContentAuthor.