Tuesday, 07 July 2020 08:39

Check Point finds a way to attack Apache Guacamole with remote code exploits

Check Point finds a way to attack Apache Guacamole with remote code exploits Courtesy Check Point

Security outfit Check Point has found a number of vulnerabilities in Apache Guacamole, popular infrastructure that is used for remote work by more than 10 million organisations or people.

Researcher Eyal Itkin said in a detailed blog post that the change in work patterns due to the coronavirus pandemic meant that IT solutions for remotely connecting to corporate networks was now being used much more widely.

He said that several critical reverse RDP (remote desktop protocol) vulnerabilities had been found in Guacamole and also affected by a few similar issues in FreeRDP.

"In short, these vulnerabilities allow an attacker, who has already successfully compromised a computer inside the organisation, to launch an attack on the Guacamole gateway when an unsuspecting worker tries to connect to an infected machine," Itkin wrote. "The malicious actor can then achieve full control over the guacamole-server, and intercept and control all other connected sessions."

Guacamole was one of the more prominent products on the market, not only on its own but because other network accessibility and security tools embedded Guacamole in their own products.

Outlining the workflow involved, Itkin said an employee would use a browser to connect to an Internet-facing server, go through an authentication process and gain access to his/her own corporate computer.

Said Itkin: "While the employee only uses his browser, the guacamole-server selects one of the supported protocols (RDP, VNC, SSH, etc.) and uses an open-source client to connect to the specific corporate computer.

"Once connected, the guacamole-server acts as a middle-man that relays events back and forth while translating them from the chosen protocol to the special 'Guacamole Protocol', and vice versa."

He said once this workflow had been understood, the next step was to examine likely attack vectors.

One was a reverse attack scenario where a compromised machine within the corporate network used an incoming harmless connection to attack the gateway in order to take it over.

A second, said Itkin, was the malicious worker scenario where a rogue employee would use a computer inside the network to strengthen his hold on both ends of the connection and gain control of the gateway.

Given that FreeRDP had already been found to have holes which Check Point had previously demonstrated, Itkin checked released Guacamole versions to see what version of FreeRDP the Apache software had incorporated.

"By looking at the released versions of Apache Guacamole, we can see that only version 1.1.0, released at the end of January 2020, added support for the latest FreeRDP version (2.0.0)," he said.

"Knowing that our vulnerabilities in FreeRDP were only patched on version 2.0.0-rc4, this means that all versions that were released before January 2020 are using vulnerable versions of FreeRDP."

Itkin said the research could have ended right there with an estimate of the high probability that there were the same bugs in Guacamole as most companies would not have upgraded. But he kept on, looking in particular for support for the RDP protocol in the code of Guacamole-Server and also looking at the code of the latest FreeRDP release.

Three information disclosure bugs were found in Guacamole and two out-of-bounds reads bugs in FreeRDP. The latter two had already been reported.

"At this point, we found five vulnerabilities that could serve as information disclosure exploit primitives in our attack," Itkin said. "However, we had yet to find even a single memory corruption vulnerability.

"Looking for such vulnerabilities in FreeRDP was quite annoying, as every time we had a lead, a check blocked it. Many times, this check was the patch for a vulnerability that we’ve reported, so we can’t really complain too much."

But his persistence finally paid off. The RDP protocol exposes different “devices” as separate “channels”, one for each device. These include the rdpsnd channel for the sound, cliprdr for the clipboard, and so on.

"As an abstraction layer, the channel messages support a fragmentation that allows their messages to be up to 4GB long. To properly support the rdpsnd and rdpdr (Device Redirection) channels, the developers of guacamole-server added an additional abstraction layer, implemented in the file: guac_common_svc.c," Itkin noted.

"We can see that the first fragment must contain the CHANNEL_FLAG_FIRST fragment, and when handled, a stream is allocated according to the overall declared length of the total message. However, what happens if an attacker sends a fragment without this flag? It seems that it is simply appended to the previous leftover stream. At this point, this looks like a very promising dangling-pointer vulnerability. Now we only need to check if the developers remembered to set it to NULL when the previous fragmented message finished its handling.

"After a fragmented message finishes the reassembly and goes on to be parsed, it is freed. And that’s it. No one sets the dangling pointer to NULL!"

He said a malicious RDP server could send an out-of-order message fragment that used the previously freed wStream object, effectively becoming a use-after-free vulnerability.

"On top of that, the wStream is the most powerful object that we could have hoped to get for such a vulnerability, as it can be used for an arbitrary write if the pointer field is set to the desired memory address. On top of all that, we have a useful information disclosure vulnerability in the rdpsnd channel, right after our corrupted wStream object is used. With some effort, a specially crafted wStream object can turn our original vulnerability into a more powerful arbitrary read exploit primitive."

The vulnerabilities have been notified to the Apache Guacamole project which released a patched version on 28 June. Itkin's research did not end there; the additional details, which include techniques for privilege escalation on Apaache Guacamole, are here.

Subscribe to ITWIRE UPDATE Newsletter here


The much awaited iTWire Shop is now open to our readers.

Visit the iTWire Shop, a leading destination for stylish accessories, gear & gadgets, lifestyle products and everyday portable office essentials, drones, zoom lenses for smartphones, software and online training.

PLUS Big Brands include: Apple, Lenovo, LG, Samsung, Sennheiser and many more.

Products available for any country.

We hope you enjoy and find value in the much anticipated iTWire Shop.



iTWire TV offers a unique value to the Tech Sector by providing a range of video interviews, news, views and reviews, and also provides the opportunity for vendors to promote your company and your marketing messages.

We work with you to develop the message and conduct the interview or product review in a safe and collaborative way. Unlike other Tech YouTube channels, we create a story around your message and post that on the homepage of ITWire, linking to your message.

In addition, your interview post message can be displayed in up to 7 different post displays on our the iTWire.com site to drive traffic and readers to your video content and downloads. This can be a significant Lead Generation opportunity for your business.

We also provide 3 videos in one recording/sitting if you require so that you have a series of videos to promote to your customers. Your sales team can add your emails to sales collateral and to the footer of their sales and marketing emails.

See the latest in Tech News, Views, Interviews, Reviews, Product Promos and Events. Plus funny videos from our readers and customers.


Sam Varghese

Sam Varghese has been writing for iTWire since 2006, a year after the site came into existence. For nearly a decade thereafter, he wrote mostly about free and open source software, based on his own use of this genre of software. Since May 2016, he has been writing across many areas of technology. He has been a journalist for nearly 40 years in India (Indian Express and Deccan Herald), the UAE (Khaleej Times) and Australia (Daily Commercial News (now defunct) and The Age). His personal blog is titled Irregular Expression.

Share News tips for the iTWire Journalists? Your tip will be anonymous




Guest Opinion

Guest Reviews

Guest Research

Guest Research & Case Studies

Channel News