Server-Side Template Injection/RCE
- CloudSEK’s Customer Threat Research Team analyzed remote code execution impacting Vmware products that include Workspace ONE Access and Identity Manager.
- The VMware Workspace ONE Access provides users faster access to SaaS, web, and native mobile apps with Multi-Factor Authentication (MFA), conditional access, and single sign-on functionality and the VMware Identity Manager is Workspace ONE’s identity and access management component.
- The server-side template injection has been assigned CVE-2022-22954 with a maximum CVSSv3 score of 9.8 and affected VMware versions include:
- VMware Workspace ONE Access Appliance – 21.08.0.1, 21.08.0.0, 22.214.171.124, 126.96.36.199
- VMware Identity Manager Appliance – 3.3.6, 3.3.5, 3.3.4, 3.3.3
- VMWare has released the patches essential to fix this vulnerability.
- On 6 April 2022, VMWare released an advisory addressing eight vulnerabilities present in Multiple VMWare products.
- CVE-2022-22954 is a server-side template injection vulnerability that can lead to remote code execution on the affected versions. It impacts the VMWare Workspace ONE Access as well as VMware Identity Manager and has been assigned a critical CVSSv3 base score of 9.8.
- To exploit the vulnerability, an attacker with network access simply needs to send a specially crafted request to a vulnerable VMware Workspace ONE or Identity Manager.
- The successful exploitation of the vulnerability could result in remote code execution on the vulnerable server.
Information from OSINT
- A Shodan search revealed that 711 publicly exposed VMWare Workspace One instances.
- Several threat actors including APT groups have targeted VMWare products in the past to conduct attacks ranging from ransomware to espionage.
Information from Cybercrime Platforms
- Multiple threat actors have been discussing this vulnerability on various cybercrime forums and Telegram channels. (For more information refer to the Appendix)
- The discussions comprise the following information:
- Methods of leveraging the impact by chaining exploits.
- Shodan queries to search for vulnerable instances in the wild.
- Functioning proof of concepts (PoCs) by request using intercepting tools like BurpSuite.
How does SSTI Result in Remote Code Execution?
- An SSTI(server-side template injection) vulnerability results in the ability to execute commands on the remote server. This attack vector is very well documented and affects almost all the major backend infrastructures and related templates e.g. – FreeMarker/Java, Velocity/Java, Twig/PHP, Jade/Nodejs and the list goes on.
- Server-side template injection attacks can occur whenever user input is concatenated directly into a template, rather than being passed in as data. Hence, attackers can manipulate the template engine by injecting arbitrary template directives.
- An attacker can use this to execute commands and execute reverse shell payloads that could potentially result in Remote Code Execution. This makes the vulnerability extremely easy to exploit while granting complete server control.
POC (Proof of Concept)
PoC for CVE-2022-22954
- The above GET request will return the contents of the /etc/passwd file from a vulnerable server.
- The URL encoded string given as a parameter to the deviceUdid argument is:
Impact & Mitigation
A threat actor discussing the vulnerability on a Telegram channel