A low-privileged authenticated attacker can unzip files uploaded to XenMobile's Tomcat server, in order to perform remote code execution.
XenMobile provides an API to unzip files by posting to:
/controlpoint/rest/application/mobile/process?fileName=file.zip
This, in combination with the unauthenticated file upload vulnerabilities described in dxw-2018-3564, allowed us to upload and unzip arbitrary files, leading to arbitrary code execution on the server.
POST /controlpoint/rest/application/mobile/process?fileName=file.zip HTTP/1.1
Host:xenmobile.example.com
Referer: https://xenmobile.example.com/index_uc.html
X-Requested-With: XMLHttpRequest
Cookie: JSESSIONID=validsession
XenMobile does not check to see if the zip file contains relative paths. This meant the tester could write files to arbitrary locations on the server by crafting zip files containing relative paths. In this case, the zip file crafted by the tester was encoded to contain a file with the path:
/../../sw/tomcat/inst1/webapps/ROOT/zdm/img/test9.jsp
test9.jsp contained code written by the attacker to allow us to run arbitrary commands on the server.
When XenMobile unzips this file, it creats test9.jsp within the web root of the Tomcat server, making it available to be executed via the web. The tester was then able to call it via HTTP from an external location, running arbitrary commands and viewing their output.