Sophos pulls out spade, fills in holes in Web Appliance
Uproots root privilege route, covers it over
Sophos has pulled out the weeds in its web-scanning software after Core Security identified multiple holes in its Web Protection Appliance versions 3.8.0, 3.8.13 and 3.7.9 and earlier.
The Core Security advisory states that if a remote attacker can gain access to the appliance's web administrator interface, the attacker could execute arbitrary commands and gain root privileges.
Acknowledging the issue to The Register, Sophos advised that it had not observed any exploits of the vulnerability in the wild.
The issue arises via a slip in a Perl script, as the advisory states:
[T]he invoked /opt/ws/bin/sblistpack Perl script itself is vulnerable to OS command injection, because its get_referers() function doesn't escape the first argument of the script before using it within a string that will be executed as a command by using backticks.
This opens a vulnerability in which a POST parameter allows the attacker to execute OS commands on the appliance, with the privileges of the operating system user – in this case, "spiderman".
To get from spiderman's OS user privileges to root privileges, the Core Security testers then located a Perl command which runs with root privileges, and which also had an escaping error. Core Security points out that the script “doesn't escape the second argument of the script before using it within a string that will be executed as a command by using backticks. Since it can be run by the spiderman user with the sudo* command, it can be abused to gain root privileges within the appliance.”
Sophos has acknowledged the issue, and Core Security's disclosure, in this notice.
The company says it is now rolling out the update to customers with automatic updating. Customers who have disabled automatic updates can run a manual install. The fix was posted on Friday 6 September. ®
* "sudo", or "superuser do" allows users to run programs with the security privileges of another user.