Headline
CVE-2023-26056: XWIKI-19856: Bad execution setup on the context macro · xwiki/xwiki-platform@4b75f21
XWiki Platform is a generic wiki platform. Starting in version 3.0-milestone-1, it’s possible to execute a script with the right of another user, provided the target user does not have programming right. The problem has been patched in XWiki 14.8-rc-1, 14.4.5, and 13.10.10. There are no known workarounds for this issue.
@@ -22,7 +22,6 @@ import java.util.Arrays; import java.util.Collections;
import javax.inject.Inject; import javax.inject.Named;
import org.junit.jupiter.api.BeforeEach; @@ -51,8 +50,10 @@ import org.xwiki.test.TestEnvironment; import org.xwiki.test.annotation.ComponentList; import org.xwiki.test.junit5.mockito.ComponentTest; import org.xwiki.test.junit5.mockito.InjectComponentManager; import org.xwiki.test.junit5.mockito.InjectMockComponents; import org.xwiki.test.junit5.mockito.MockComponent; import org.xwiki.test.mockito.MockitoComponentManager;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; @@ -80,9 +81,6 @@
private static final DocumentReference SOURCE_REFERENCE = new DocumentReference("wiki", "space", “source”);
@Inject protected BlockAsyncRendererExecutor executor;
@MockComponent private DocumentAccessBridge dab;
@@ -100,11 +98,16 @@ private DocumentReferenceResolver<String> macroReferenceResolver;
@MockComponent protected DocumentReferenceResolver<String> resolver; private DocumentReferenceResolver<String> resolver;
@InjectMockComponents private ContextMacro macro;
@InjectComponentManager private MockitoComponentManager componentManager;
private BlockAsyncRendererExecutor executor;
@BeforeEach public void beforeEach() throws Exception { @@ -117,6 +120,8 @@ public void beforeEach() throws Exception
when(this.macroReferenceResolver.resolve(eq(“target”), any())).thenReturn(TARGET_REFERENCE); when(this.resolver.resolve(“source”)).thenReturn(SOURCE_REFERENCE);
this.executor = this.componentManager.getInstance(BlockAsyncRendererExecutor.class); }
@Test
Related news
### Impact It's possible to execute a script with the right of another user (provided the target user does not have programming right). For example, the following: ``` {{context document="xwiki:XWiki.userwithscriptright" transformationContext="document"}}{{velocity}}Hello from Velocity!{{/velocity}}{{/context}} ``` written by a user not having script right (for example in the user's profile) should produce an error (the user is not allowed to write scripts). However, because of the vulnerability, if the author of the document "xwiki:XWiki.userwithscriptright" has script right (but not programming right) the script will be executed with as if it was written by the target user. ### Patches The problem has been patched in XWiki 14.8RC1, 14.4.5 and 13.10.10. ### Workarounds There's no workaround for this issue. ### References https://jira.xwiki.org/browse/XWIKI-19856 ### For more information If you have any questions or comments about this advisory: * Open an issue in [JIRA](htt...