Barracuda has patched a zero-day vulnerability that had been exploited since October to backdoor customers’ Email Security Gateway (ESG) appliances with custom malware and steal data, said the company.
“On May 19, 2023, Barracuda Networks identified a remote command injection vulnerability (CVE-2023-2868) present in the Barracuda Email Security Gateway (appliance form factor only) versions 5.1.3.001-9.2.0.006,” the company said, adding that the vulnerability stemmed from incomplete input validation of user-supplied .tar files as it pertains to the names of the files contained within the archive.
Discovery and patching of the vulnerability
Barracuda identified the vulnerability on May 19, a day after it was alerted about anomalous traffic originating from its ESG appliances. The vulnerability existed in a module that initially screens the attachments of incoming emails.
On the following day, a security patch to remediate the vulnerability was applied to all ESG appliances worldwide.
“On May 21, 2023, a script was deployed to all impacted appliances to contain the incident and counter unauthorised access methods. A series of security patches are being deployed to all appliances in furtherance of our containment strategy,” the company said.
The earliest identified evidence of exploitation of the vulnerability was in October 2022. The vulnerability was utilised to obtain unauthorised access to a subset of ESG appliances.
A malware was identified on a subset of appliances allowing for persistent backdoor access. “Evidence of data exfiltration was identified on a subset of impacted appliances,” Barracuda said.
The malware used
There were several malware that were used to exploit the vulnerability. Barracuda has deployed Mandiant to investigate the same as well as links of the malware to any previously known backdoor.
Saltwater is a trojanized module for the Barracuda SMTP daemon (bsmtpd) that contains backdoor functionality. The capabilities of Saltwater include the ability to upload or download arbitrary files, and execute commands, as well as proxy and tunneling capabilities, the company said.
“The backdoor is implemented using hooks on the send, recv, close syscalls and amounts to five components, most of which are referred to as “Channels” within the binary,” the company said. The five channels are DownloadChannel, UploadChannel, ProxyChannel, ShellChannel, and TunnelArgs.
The next malware strain deployed during the campaign is SeaSpy. This malware strain provides persistence and can be activated using magic packets. “It helps monitor port 25 (SMTP) traffic, and some of its code overlaps with the publicly available cd00r passive backdoor,” Barracuda said.
The threat actors also used a Lua-based module called Seaside for the Barracuda SMTP daemon that monitors SMTP HELO/EHLO commands to receive a command-and-control IP address and port which it passes as arguments to an external binary that establishes a reverse shell, the company said.
Informing and safeguarding customers
Users whose appliances the company believes were impacted have been notified via the ESG user interface of actions to take. Barracuda has also reached out to these specific customers.
The company has advised users to investigate their environments, probably to ensure the attackers move laterally to other devices on their network. It also advises customers to ensure their ESG appliance is receiving and applying updates, definitions, and security patches from Barracuda.