Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
148cd51a
Commit
148cd51a
authored
Jul 30, 2015
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #265 from surevine/dwd/xss
Address XSS issues in admin console and monitoring plugin
parents
76e2af85
edc70316
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
12 deletions
+22
-12
plugin.xml
src/plugins/monitoring/plugin.xml
+1
-1
ConversationUtils.java
.../org/jivesoftware/openfire/archive/ConversationUtils.java
+3
-1
archive-conversation-participants.jsp
.../monitoring/src/web/archive-conversation-participants.jsp
+3
-2
archive-search.jsp
src/plugins/monitoring/src/web/archive-search.jsp
+5
-5
conversations.jsp
src/plugins/monitoring/src/web/conversations.jsp
+3
-3
web.xml
src/web/WEB-INF/web.xml
+7
-0
No files found.
src/plugins/monitoring/plugin.xml
View file @
148cd51a
...
...
@@ -5,7 +5,7 @@
<name>
Monitoring Service
</name>
<description>
Monitors conversations and statistics of the server.
</description>
<author>
Jive Software
</author>
<version>
1.4.
4
</version>
<version>
1.4.
5
</version>
<date>
10/28/2014
</date>
<minServerVersion>
3.9.0
</minServerVersion>
<databaseKey>
monitoring
</databaseKey>
...
...
src/plugins/monitoring/src/java/org/jivesoftware/openfire/archive/ConversationUtils.java
View file @
148cd51a
...
...
@@ -37,6 +37,7 @@ import org.jivesoftware.openfire.user.UserManager;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.LocaleUtils
;
import
org.jivesoftware.util.NotFoundException
;
import
org.jivesoftware.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.xmpp.packet.JID
;
...
...
@@ -328,8 +329,9 @@ public class ConversationUtils {
if
(
conversation
.
getRoom
()
!=
null
)
{
from
=
message
.
getToJID
().
getResource
();
}
from
=
StringUtils
.
escapeHTMLTags
(
from
);
String
cssLabel
=
cssLabels
.
get
(
message
.
getFromJID
().
toBareJID
());
String
body
=
message
.
getBody
(
);
String
body
=
StringUtils
.
escapeHTMLTags
(
message
.
getBody
()
);
builder
.
append
(
"<tr valign=top>"
);
if
(!
message
.
isRoomEvent
())
{
builder
.
append
(
"<td width=1% nowrap class="
+
cssLabel
+
">"
).
append
(
"["
)
...
...
src/plugins/monitoring/src/web/archive-conversation-participants.jsp
View file @
148cd51a
...
...
@@ -7,6 +7,7 @@
<%@ page
import=
"org.jivesoftware.util.Log"
%>
<%@ page
import=
"org.jivesoftware.util.NotFoundException"
%>
<%@ page
import=
"org.jivesoftware.util.ParamUtils"
%>
<%@ page
import=
"org.jivesoftware.util.StringUtils"
%>
<%@ page
import=
"org.xmpp.packet.JID"
%>
<%@ page
import=
"java.util.*"
%>
...
...
@@ -179,14 +180,14 @@
%>
<tr>
<td><%=
nickname
%>
<i>
(
<%=
server
.
isLocal
(
participant
)
&&
userManager
.
isRegisteredUser
(
participant
)
?
"<a href='/user-properties.jsp?username="
+
participant
.
getNode
()
+
"'>
" + participant.toBareJID() + "
</
a
>"
:
participant
.
toBareJID
()
%>
)
</i></td>
<td><%=
StringUtils
.
escapeHTMLTags
(
nickname
)
%>
<i>
(
<%=
server
.
isLocal
(
participant
)
&&
userManager
.
isRegisteredUser
(
participant
)
?
"<a href='/user-properties.jsp?username="
+
participant
.
getNode
()
+
"'>
" + participant.toBareJID() + "
</
a
>"
:
participant
.
toBareJID
()
%>
)
</i></td>
<%
if
(
it
.
hasNext
())
{
participation
=
it
.
next
();
nickname
=
participation
[
0
];
participant
=
new
JID
(
participation
[
1
]);
%>
<td><%=
nickname
%>
<i>
(
<%=
server
.
isLocal
(
participant
)
&&
userManager
.
isRegisteredUser
(
participant
)
?
"<a href='/user-properties.jsp?username="
+
participant
.
getNode
()
+
"'>
" + participant.toBareJID() + "
</
a
>"
:
participant
.
toBareJID
()
%>
)
</i></td>
<td><%=
StringUtils
.
escapeHTMLTags
(
nickname
)
%>
<i>
(
<%=
server
.
isLocal
(
participant
)
&&
userManager
.
isRegisteredUser
(
participant
)
?
"<a href='/user-properties.jsp?username="
+
participant
.
getNode
()
+
"'>
" + participant.toBareJID() + "
</
a
>"
:
participant
.
toBareJID
()
%>
)
</i></td>
<%
}
else
{
%>
<td>
</td>
<%
}
%>
...
...
src/plugins/monitoring/src/web/archive-search.jsp
View file @
148cd51a
...
...
@@ -514,14 +514,14 @@
</tr>
<tr>
<td>
<input
type=
"text"
size=
"22"
name=
"participant1"
value=
"
<%=
participant1
!=
null
?
participant1
:
<input
type=
"text"
size=
"22"
name=
"participant1"
value=
"
<%=
participant1
!=
null
?
StringUtils
.
escapeForXML
(
participant1
)
:
LocaleUtils
.
getLocalizedString
(
"archive.search.participants.any"
,
"monitoring"
)
%>
"
class=
"textfield"
/>
</td>
</tr>
<tr>
<td>
<input
type=
"text"
size=
"22"
name=
"participant2"
value=
"
<%=
participant2
!=
null
?
participant2
:
anyText
%>
"
class=
"textfield"
/>
<input
type=
"text"
size=
"22"
name=
"participant2"
value=
"
<%=
participant2
!=
null
?
StringUtils
.
escapeForXML
(
participant2
)
:
anyText
%>
"
class=
"textfield"
/>
</td>
</tr>
...
...
@@ -546,7 +546,7 @@
<td><fmt:message
key=
"archive.search.daterange.start"
/></td>
<td>
<input
type=
"text"
id=
"startDate"
name=
"startDate"
size=
"13"
value=
"
<%=
startDate
!=
null
?
startDate
:
value=
"
<%=
startDate
!=
null
?
StringUtils
.
escapeForXML
(
startDate
)
:
LocaleUtils
.
getLocalizedString
(
"archive.search.daterange.any"
,
"monitoring"
)
%>
"
class=
"textfield"
/><br/>
<span
class=
"jive-description"
><fmt:message
key=
"archive.search.daterange.format"
/></span>
</td>
...
...
@@ -558,7 +558,7 @@
<td><fmt:message
key=
"archive.search.daterange.end"
/></td>
<td>
<input
type=
"text"
id=
"endDate"
name=
"endDate"
size=
"13"
value=
"
<%=
endDate
!=
null
?
endDate
:
value=
"
<%=
endDate
!=
null
?
StringUtils
.
escapeForXML
(
endDate
)
:
LocaleUtils
.
getLocalizedString
(
"archive.search.daterange.any"
,
"monitoring"
)
%>
"
class=
"textfield"
/><br/>
<span
class=
"jive-description"
><fmt:message
key=
"archive.search.daterange.format"
/></span>
</td>
...
...
@@ -586,7 +586,7 @@
<tr>
<td>
<%
if
(
isArchiveEnabled
){
%>
<input
type=
"text"
name=
"keywords"
size=
"35"
class=
"keyword-field"
value=
"
<%=
query
!=
null
?
query
:
""
%>
"
/>
<input
type=
"text"
name=
"keywords"
size=
"35"
class=
"keyword-field"
value=
"
<%=
query
!=
null
?
StringUtils
.
escapeForXML
(
query
)
:
""
%>
"
/>
<%
}
else
{
%>
<fmt:message
key=
"archive.search.keywords.disabled"
>
<fmt:param
value=
"<a href='archiving-settings.jsp'>"
/>
...
...
src/plugins/monitoring/src/web/conversations.jsp
View file @
148cd51a
...
...
@@ -131,7 +131,7 @@ function updateConversations(data) {
<!-- <a href="#" onclick="conversationUpdater(); return false;">click me</a> -->
<p>
<fmt:message
key=
"archive.conversations"
/>
<span
id=
"activeConversations"
><%=
conversationManager
.
getConversationCount
()
%></span
<span
id=
"activeConversations"
><%=
conversationManager
.
getConversationCount
()
%></span
>
</p>
<%
...
...
@@ -169,9 +169,9 @@ function updateConversations(data) {
<%
if
(
conversation
.
getRoom
()
==
null
)
{
%>
<%
for
(
JID
jid
:
participants
)
{
%>
<%
if
(
server
.
isLocal
(
jid
)
&&
userManager
.
isRegisteredUser
(
jid
.
getNode
()))
{
%>
<a
href=
"/user-properties.jsp?username=
<%=
jid
.
getNode
()
%>
"
><%=
jid
%></a><br
/>
<a
title=
'User Link'
href=
"/user-properties.jsp?username=
<%=
jid
.
getNode
()
%>
"
><%=
StringUtils
.
escapeHTMLTags
(
jid
.
toBareJID
())
%></a><br
/>
<%
}
else
{
%>
<%=
jid
.
toBareJID
(
)
%><br/>
<%=
StringUtils
.
escapeHTMLTags
(
jid
.
toBareJID
()
)
%><br/>
<%
}
%>
<%
}
%>
<%
}
else
{
%>
...
...
src/web/WEB-INF/web.xml
View file @
148cd51a
...
...
@@ -8,6 +8,13 @@
<display-name>
Openfire
</display-name>
<!-- OF-902 use HttpOnly for session cookie -->
<session-config>
<cookie-config>
<http-only>
true
</http-only>
</cookie-config>
</session-config>
<!-- prevent URL rewritting with jsessionid included, OF-669 -->
<context-param>
<param-name>
org.eclipse.jetty.servlet.SessionIdPathParameterName
</param-name>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment