The jabber server Openfire contains several serious vulnerabilities. Depending on the particular runtime environment these issues can potentially even be used by an attacker to execute code on operating system level.
1) Authentication bypass
This vulnerability provides an attacker full access to all functions in the admin webinterface without providing any user credentials. The Tomcat filter which is responsible for authentication could be completely circumvented.
2) SQL injection
It is possible to pass SQL statements to the backend database through a SQL injection vulnerability. Depending on the particular runtime environment and database permissions it is even possible to write files to disk and execute code on operating system level.
3) Multiple Cross-Site Scripting
a destination to which a user will be forwarded to after successful authentication.
* Openfire Server version 3.6.0a
1) Authentication bypass
Authentication to the openfire admin interface is secured by a filter in the Tomcat application server (org.jivesoftware.admin.AuthCheckFilter). This filter guarantees that access to the admin interface is only granted to authenticated users. Otherwise they get redirected to a login page.
A design error in Openfire enables access to internal functions without the need for admin user credentials. The deployment descriptor (web.xml) configures some exclude values for the AuthCheckFilter:
When a request URL contains one of these Exclude-Strings the auth check mechanism is totally circumvented. This was considered necessary for the initial setup process or the presence plugin. Following POC demonstrates how an attacker could access internal functions by manipulating the URL providing one of these excludes(/setup/setup-/../../): http://www.foo.bar:9090/setup/setup-/../../log.jsp?log=info&mode=asc&lines=All
2) SQL injection
The parameter "type" in sipark-log-summary.jsp is prone to SQL injection. Untrusted user data enters the application in sipark-log-summary.jsp (line 163):
String type = ParamUtils.getParameter(request, "type");
The function getCalls() in org.jivesoftware.openfire.sip.calllog.CallLogDAO processes this user input (SQLCondition) and constructs a SQL statement:
That statement is executed in the method createScrollablePreparedStatement() in CallLogDAO (line 411):
In that case there is a SQL injection vulnerability present even though prepared statemens are used. This happens because the string sql is dynamically concatenated *before* it is passed to the prepared statement object.
3) Cross-Site Scripting
The parameter "url" in login.jsp was vulnerable to Cross-Site Scripting (XSS). This vulnerability is the only one which was fixed within the last 6 months.
An attacker could also manipulate the parameter to specify a destination to which a user will be forwarded to after successful authentication:
If a user authenticates using that link it is easily possible for an attacker to hijack the users session.
Furthermore the parameter "username" in login.jsp is still vulnerable to Cross-Site Scripting attacks.
Putting it all together:
Since the SIP-Plugin is deactivated by default, an attacker needs to install it using the authentication bypass vulnerability and the following POST request:
POST http://www.foo.bar:9090/setup/setup-/../../dwr/exec/downloader.installPlugin.dwr HTTP/1.1
After that activation the described SQL injection vulnerability can be used in a single unauthenticated request. The following proof of concept uses a mysql database: http://www.foo.bar:9090/setup/setup-/../../plugins/sip/sipark-log-summary.jsp?
Since the vendor didn't release a patch within the last 6 months it is highly recommended to deactivate access to the entire admin interface. This can be achieved for example by blocking the according ports (tcp/9090 & tcp/9091 by default) with a firewall. Following communication to the admin interface can be done via SSL tunnels.
2008/05/17 - Vendor notified using email@example.com
2008/05/18 - Vendor notified using firstname.lastname@example.org
2008/05/20 - Vendor response
2008/05/20 - Detailed vulnerability information sent to the vendor
2008/05/21 - Vendor confirms the vulnerability
2008/08/18 - Asked vendor for up to date information regarding the reported issues
2008/10/18 - Again asked vendor for up to date information regarding the reported issues
2008/10/31 - Informed vendor of planned advisory realease on 2008/11/05 (no response)
2008/11/07 - Full technical details and recommended measures released to general public