Security Advisory 06 – 062 – SurgeFTP is vulnerable to Cross-site Scripting(XSS)
Vulnerability discovery and development:
Portcullis Security Testing services discovered this vulnerability.
Credit for Discovery:
Nico Leidecker – Portcullis Computer Security Ltd.
Version 2.3a1 Linux and probably other platforms.
SurgeFTP provides a web interface for managing mirrored servers. The state of every last mirroring process is displayed in the overview screen. If SurgeFTP receives a server response where the first characters are not the numeric status code, an error message is printed which also includes the received message from the mirrored server. SurgeFTP fails to sanitise HTML and script code from that message.
An attacker can gain root access on the server. In order to achieve that, he will have the ability to execute script code that creates an FTP user who can access the real root directory and acts without dropping privileges. In one scenario, for the next step, the attacker accesses the vulnerable host via FTP and uploads a modified crontab file with the intention of executing a command which binds a shell to a port.
The proof of concept exploit code is available.
Vendor notified. The vulnerability has been fixed.