SEC Consult SA-20130124-0 :: Critical SSH Backdoor in multiple Barracuda Networks Products Jan 24 2013 12:00PM
SEC Consult Vulnerability Lab (research sec-consult com)
SEC Consult Vulnerability Lab Security Advisory < 20130124-0 >
title: Critical SSH Backdoor in multiple Barracuda Networks
vulnerable products: Barracuda Spam and Virus Firewall
Barracuda Web Filter
Barracuda Message Archiver
Barracuda Web Application Firewall
Barracuda Link Balancer
Barracuda Load Balancer
Barracuda SSL VPN
(all including their respective virtual "Vx" versions)
vulnerable version: all versions < Security Definition 2.0.5
fixed version: Security Definition 2.0.5
impact: Critical
homepage: https://www.barracudanetworks.com/
found: 2012-11-20
by: S. Viehböck
SEC Consult Vulnerability Lab

Vendor/product description:
URL: https://www.barracudanetworks.com/products/

Vulnerability overview/description:
1) Backdoor accounts
Several undocumented operating system user accounts exist on the appliance.
They can be used to gain access to the appliance via the terminal but also
via SSH. (see 2)
These accounts are undocumented and can _not_ be disabled!

2) Remote access via SSH
An SSH daemon runs on the appliance, but network filtering (iptables) is used
to only allow access from whitelisted IP ranges (private and public).

The public ranges include servers run by Barracuda Networks Inc. but also
servers from other, unaffiliated entities - all of whom can access SSH on all
affected Barracuda Networks appliances exposed to the Internet.

The backdoor accounts from 1) can be used to gain shell access.
This functionality is entirely undocumented and can only be disabled via a
hidden 'expert options' dialog (see Workaround).

Proof of concept:
URLs and other exploit code (passwords) have been removed from this advisory.
A detailed advisory will be released within a month including the omitted

1) Backdoor accounts
The passwd and shadow file show that the following accounts exist.
Some passwords could be recovered (short attack with tiny wordlist):

root:x:0:0:root:/root:/bin/bash <-- UID: 0!
<hash removed>
NOT CRACKED during given time (confirmed static in tested appliances)

build:x:0:0:Build User:/root:/boot/os_tools/clone_interactive.pl <-- UID: 0!
<hash removed>
NOT CRACKED during given time

shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown -h now
<hash removed>
CRACKED <password removed>

<hash removed>
CRACKED <password removed>

ca:x:704:65534:ACL reset user:/home/ca:/home/emailswitch/code/firmware/current/bin/clear_acls.sh
<hash removed>
CRACKED <password removed>

<hash removed>
CRACKED <password removed>

<hash removed>
CRACKED <password removed>

<hash removed>
NOT CRACKED during given time

The following users have public keys added to their authorized_keys

remote:x:0:0:Remote Access:/home/remote:/bin/bash <-- UID: 0!
# cat /home/remote/.ssh/authorized_keys2
ssh-dss AAAAB3NzaC1kc3MAAACBAM3angjOeIjCePKw8a/zTugPKK+hoYkpQhyXY8+BN
Q3sgpXBhW6YT+rqrJLgc9l3Y2/exVGJjYA== manager (at) support01 (dot) barr [email concealed]acudanetwo

# cat /home/cluster/.ssh/authorized_keys2
ssh-dss AAAAB3NzaC1kc3MAAACBAJ5O8UhVP3lb0Mff66uHMkvcZlxPJF/7pgtcq5Qd/

At least the user "product" can be used to login and get a shell on the

It was confirmed that this user can access the MySQL database (root@localhost
with no password) eg. to add new users with administrative privileges to the
appliance configuration.
Furthermore it was possible to enable diagnostic/debugging functionality
which could be used to gain root access on the system. (confirmed in
Barracuda SSL VPN)

2) Remote access via SSH
An /etc/sysconfig/iptables file shows which rules are in place:

# Generated by iptables-save v1.2.7a on Thu Oct 9 16:39:19 2003
:PREROUTING ACCEPT [4012:488438]
:OUTPUT ACCEPT [641:40599]
# Completed on Thu Oct 9 16:39:19 2003
# Generated by iptables-save v1.2.7a on Thu Oct 9 16:39:19 2003
:INPUT ACCEPT [42408:13197223]
:OUTPUT ACCEPT [49685:7341128]
-A INPUT -s localhost -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j REJECT --reject-with icmp-port-unreachable
# Completed on Thu Oct 9 16:39:19 2003

The timestamp and the version of iptables-save suggest that these rules might
have been in place on Barracuda Networks appliances since 2003.

Users from these networks can access the SSH daemon running (by default on the
tested appliances) on port 22 e.g. by using the backdoor accounts:

* Private IP ranges

In some situations a user might be able to set his IP address (in the local
network) to one within the private ranges and then be allowed to access SSH.

* Public IP ranges

These ranges include some servers run by Barracuda Networks eg.
spam04.barracuda.com (
forum.barracudanetworks.com (
barracudacentral.org (
repsrv.barracuda.com (
mirror01.barracudacentral.com (

but also servers from other entities:
mail.totalpaas.com ( - Domain registered by: Domains By Proxy, LLC ...
frmt1.boxitweb.com ( - Domain registered by: Thor Myhrstad
static.medallia.com ( - Domain registed by: Medallia Inc.
utility.connectify.net ( - Domain registered by: Connectify Networks, Inc.
everest.address.com ( - Domain registed by: WhitePages, Inc.
mail.tqm.bz ( - Domain registered by: Total Quality Maintenance, Inc
outbound.andyforbes.com ( - Domain registered by: HM hosting

More information about the hosts in these /24 networks can be found at:

A breach of any server in the whitelisted ranges enables an attack against all
affected Barracuda Networks appliances on the web.

The credentials from 1) (eg. "product" user) can be used to get a shell
on a appliance.

Vulnerable / tested versions:
The vulnerability has been verified to exist in Barracuda SSL VPN version, which was the most recent version at the time of discovery.

Barracuda Networks confirmed that _all_ of their appliances with the exception
of the Barracuda Backup Server, Barracuda Firewall, and Barracuda NG Firewall
are affected as well in _all_ available versions.

Vendor contact timeline:
2012-11-29: Contacting vendor.
2012-11-29: Sending advisory and proof of concept exploit via encrypted
2012-12-04: Vendor confirms receipt and provides BNSEC IDs.
2012-12-05: Requesting further coordination (conference call).
2012-12-13: Sending reminder regarding SEC Consult disclosure policy.
2012-12-15: Vendor responds - arranging conference call.
2012-12-18: Conference call: Addressing the risks the discovered
vulnerabilities pose to customers and release schedule.
2013-01-14: Vendor sends listing of reported vulnerabilities and release
2013-01-21: Conference call - discussing implemented solutions.
2013-01-21: Vendor provides information about some questions which came up.
2013-01-22: Asking for definitive listing of affected appliances.
2013-01-23: Barracuda Networks releases alert & secdef
2013-01-24: SEC Consult releases coordinated security advisory.

Update to Security Definition 2.0.5.

This will change the sshd config to only allow logins from the following users:
* cluster (login with pubic/private key)
* remote (login with pubic/private key, Barracuda Networks is in possession
of the corresponding private key)
* root (login with password, password hash (listed above) might be crackable
depending on password strength)

According to Barracuda Networks these accounts are essential for customer
support and will not be removed.

The vulnerability described in 2) is _not_ handled by this patch.

This still leaves considerable risks to appliances as the password for the
'root' user might be crackable and the relevant private keys for the 'remote'
user might be stolen from Barracuda Networks.

In secure environments it is highly undesirable to use appliances with
backdoors built into them. Even if only the manufacturer can access them.

Place the appliances behind a firewall and block any incoming traffic
(local and Internet) to port 22.

Barracuda Networks offers an expert option that disables the SSH daemon.
For assistance contact the Barracuda Networks Support.

Advisory URL:

SEC Consult Unternehmensberatung GmbH

Office Vienna
Mooslackengasse 17
A-1190 Vienna

Tel.: +43 / 1 / 890 30 43 - 0
Fax.: +43 / 1 / 890 30 43 - 25
Mail: research at sec-consult dot com

EOF S. Viehböck / @2013

[ reply ]


Privacy Statement
Copyright 2010, SecurityFocus