Working as security consultants is highly rewarding. Companies depend on us to view their environment from the perspective of an attacker and find vulnerabilities that could enable threats to succeed. One of the most impactful parts of our role is when we’re the first to find a major vulnerability that could lead to a widespread compromise beyond just our client.

That’s what happened this year with the Cisco Unified Communications Manager (CUCM) IM & Presence appliance. We performed an application penetration test against it for one of our clients. While doing so, we discovered an opening that could effect anyone who uses this appliance. Read on to find out how we explored the product, how we broke it and how to put it back together.

What Is the CUCM Product?

The CUCM solution is a middleware component that allows enterprises to integrate their various communication devices and manage them using one platform. In short, it unifies voice, video, data and mobile applications on fixed and mobile networks. Starting with the Cisco Unified Communications 9.0, the Cisco Unified Presence technology is integrated within the CUCM. Nowadays, most people refer to this solution as the CUCM IM & Presence Service. Almost every customer that uses the Cisco Jabber instant messaging application has the CUCM IM & Presence deployment.

The Findings

During the pen test, we first tried to use the least possible privilege to pinpoint the vulnerabilities that the least trusted users can reach. Then, we created a replica of the appliance in a lab environment. Using several reverse engineering techniques, we extracted the source code of the web application used to manage the appliance.

Through both dynamic testing and analysis of the source code, we found the following vulnerabilities:

  • 3 x Structured Query Language (SQL) injection (CVE-2021-1355, CVE-2021-1364, CVE-2021-1282)
  • SQL injection leads to arbitrary code execution (CVE-2021-1363, CVE-2021-1365)
  • Path traversal (CVE-2021-1357)
  • Cross-site scripting (CVE-2021-1407, CVE-2021-1408)

The main objective was to find vulnerabilities that attackers could exploit to elevate their privilege on the appliance. At first, our team managed to identify several SQL injection vulnerabilities, but the application had a protection module that filtered the user input. By inspecting this module, we found a weakness in the module logic that we used to bypass it. This allowed one to exploit three SQL injection vulnerabilities. An attacker could use this to extract sensitive information from the application database, including the administrator password hash.

Other Vulnerabilities

One of the SQL injections was chained with another vulnerability — an operating system command injection vulnerability — to achieve arbitrary code execution on the appliance. The chained attack could enable an attacker with low privileges on the appliance to escalate their privilege to root shell access. At that point, the attacker could have full control of the appliance, and the access could be used to move laterally inside the internal network and attack internal assets and other users.

We also discovered a local file read vulnerability in one of the application’s endpoints. This could allow an attacker to read any locally accessible file on the web server through the vulnerable endpoint.

Finally, we discovered a way to bypass and evade application security controls to exploit multiple reflected cross-site scripting issues on multiple endpoints. An attacker could exploit this vulnerability by constructing a request with an injected malicious payload in the vulnerable parameters and deceive the logged-in users to visit it.

The malicious payload injected by the attacker is executed within the victim’s browser, in the context of that victim’s session. The malicious application allows the attacker to hijack the user session and redirect the victim to an attacker-controlled domain or another client-side attack. That might be in-browser keylogging or performing arbitrary actions within the context of the application.

We also discovered sensitive information disclosure in one of the application endpoints. This could allow an authenticated attacker to disclose users’ hashed passwords, which could then be recovered using a dictionary attack.

Moving Laterally Through the Enterprise

As a result of these vulnerabilities, a low-privileged user could elevate their privileges to the highest level on the CUCM appliance. From there, they could access sensitive data, manipulate sensitive configurations and install malicious software on the appliance that monitors and records the communication between Cisco Jabber users. An attacker could hijack logged-in user sessions or deceive users to steal their credentials. Furthermore, since the application allows for code execution, an attacker could use it as a foothold within the network from which to move laterally.

The Next Steps: Reducing the Risk of Compromise

So, what should you do about it? We recommend you install the latest patch for the Cisco Unified Communications Products from the Cisco security advisories. The patches for both the CUCM and the CUCM IM & Presence are shown in the charts below. Links to the advisories are located in the References section.

A continuous penetration testing program can also help discover and fix these types of vulnerabilities. Learn more about X-Force Red’s penetration testing services here.

On July 21, 2021, X-Force Red will be hosting a virtual panel session about threats against and vulnerabilities exposing Internet of Things (IoT) devices. The presenters will include IoT industry leaders such as the ioXt Alliance and Silicon Labs.

Register here

References

CUCM IM & Presence SQL injection vulnerability leads to arbitrary code execution:
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-imp-inj-ereCOKjR

CUCM IM & Presence SQL injection vulnerability leads to local file disclosure and path traversal vulnerabilities:
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-imp-trav-inj-dM687ZD6

CUCM cross-site scripting vulnerability leads to attack on other appliance users:
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-cucm-xss-Q4PZcNzJ
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-cucm-inf-disc-wCxZNjL2

More from Software Vulnerabilities

Analysis of a Remote Code Execution (RCE) Vulnerability in Cobalt Strike 4.7.1

Command & Control (C2) frameworks are a very sensitive component of Red Team operations. Often, a Red Team will be in a highly privileged position on a target’s network, and a compromise of the C2 framework could lead to a compromise of both the red team operator’s system and control over beacons established on a target’s systems. As such, vulnerabilities in C2 frameworks are high priority targets for threat actors and Counterintelligence (CI) operations. On September 20, 2022, HelpSystems published…

Controlling the Source: Abusing Source Code Management Systems

For full details on this research, see the X-Force Red whitepaper “Controlling the Source: Abusing Source Code Management Systems”. This material is also being presented at Black Hat USA 2022. Source Code Management (SCM) systems play a vital role within organizations and have been an afterthought in terms of defenses compared to other critical enterprise systems such as Active Directory. SCM systems are used in the majority of organizations to manage source code and integrate with other systems within the…

X-Force Research Update: Top 10 Cybersecurity Vulnerabilities of 2021

From 2020 to 2021, there was a 33% increase in the number of reported incidents caused by vulnerability exploitation, according to the 2022 X-Force Threat Intelligence Index. A large percentage of these exploited vulnerabilities were newly discovered; in fact, four out of the top five vulnerabilities in 2021 were newer vulnerabilities. Vulnerability exploitation was the second most common initial infection vector observed by IBM Security X-Force in 2021, falling closely behind phishing. Cybercriminals are finding new ways of bypassing security…

How Log4j Vulnerability Could Impact You

MITIGATION UPDATE: New vulnerability in 2.17 — CVE-2021-44832 Upgrade to 2.17.1 to mitigate this vulnerability Do NOT enable JNDI in any versions Follow: https://logging.apache.org/log4j/2.x/security.html If you hadn’t heard of Apache Log4j, chances are it’s on your radar now. In fact, you may have been using it for years. Log4j is a logging library. Imagine writing your daily activities into a notebook. That notebook is Log4j. Developers and programmers use it to take notes about what’s happening on applications and servers.…