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
8686ad88
Commit
8686ad88
authored
Dec 18, 2016
by
Dave Cridland
Committed by
Guus der Kinderen
Dec 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-777 Error message for CSRF failure
parent
baf3ce2a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletion
+50
-1
openfire_i18n_en.properties
src/i18n/openfire_i18n_en.properties
+1
-0
client-features.jsp
src/plugins/clientControl/src/web/client-features.jsp
+15
-0
permitted-clients.jsp
src/plugins/clientControl/src/web/permitted-clients.jsp
+15
-0
audit-policy.jsp
src/web/audit-policy.jsp
+19
-1
No files found.
src/i18n/openfire_i18n_en.properties
View file @
8686ad88
...
...
@@ -832,6 +832,7 @@ global.no=No
global.unlimited
=
Unlimited
global.test
=
Test
global.click_test
=
Click to test...
global.csrf.failed
=
CSRF Error: No changes made, you'll need to retry.
# Group Chat Service Properties Page
...
...
src/plugins/clientControl/src/web/client-features.jsp
View file @
8686ad88
...
...
@@ -40,9 +40,11 @@
Cookie
csrfCookie
=
CookieUtils
.
getCookie
(
request
,
"csrf"
);
String
csrfParam
=
ParamUtils
.
getParameter
(
request
,
"csrf"
);
boolean
csrfStatus
=
true
;
if
(
csrfCookie
==
null
||
csrfParam
==
null
||
!
csrfCookie
.
getValue
().
equals
(
csrfParam
))
{
submit
=
false
;
csrfStatus
=
false
;
}
csrfParam
=
StringUtils
.
randomString
(
16
);
CookieUtils
.
setCookie
(
request
,
response
,
"csrf"
,
csrfParam
,
-
1
);
...
...
@@ -157,6 +159,19 @@
</div>
<br>
<%
}
%>
<%
if
(
csrfStatus
==
false
)
{
%>
<div
class=
"jive-error"
>
<table
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
>
<tbody>
<tr><td
class=
"jive-icon"
><img
src=
"images/error-16x16.gif"
width=
"16"
height=
"16"
border=
"0"
alt=
""
></td>
<td
class=
"jive-icon-label"
>
<fmt:message
key=
"global.csrf.failed"
/>
</td></tr>
</tbody>
</table>
</div><br>
<%
}
%>
<p>
<fmt:message
key=
"client.features.info"
/>
</p>
...
...
src/plugins/clientControl/src/web/permitted-clients.jsp
View file @
8686ad88
...
...
@@ -78,12 +78,14 @@
boolean
remove
=
request
.
getParameter
(
"removeClient"
)
!=
null
;
Cookie
csrfCookie
=
CookieUtils
.
getCookie
(
request
,
"csrf"
);
String
csrfParam
=
ParamUtils
.
getParameter
(
request
,
"csrf"
);
boolean
csrfStatus
=
true
;
if
(
submit
||
addOther
||
remove
)
{
if
(
csrfCookie
==
null
||
csrfParam
==
null
||
!
csrfCookie
.
getValue
().
equals
(
csrfParam
))
{
submit
=
false
;
addOther
=
false
;
remove
=
false
;
csrfStatus
=
false
;
}
}
csrfParam
=
StringUtils
.
randomString
(
16
);
...
...
@@ -252,6 +254,19 @@
</div>
<br>
<%
}
%>
<%
if
(
csrfStatus
==
false
)
{
%>
<div
class=
"jive-error"
>
<table
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
>
<tbody>
<tr><td
class=
"jive-icon"
><img
src=
"images/error-16x16.gif"
width=
"16"
height=
"16"
border=
"0"
alt=
""
></td>
<td
class=
"jive-icon-label"
>
<fmt:message
key=
"global.csrf.failed"
/>
</td></tr>
</tbody>
</table>
</div><br>
<%
}
%>
...
...
src/web/audit-policy.jsp
View file @
8686ad88
...
...
@@ -63,11 +63,13 @@
Map
<
String
,
String
>
errors
=
new
HashMap
<
String
,
String
>
();
Cookie
csrfCookie
=
CookieUtils
.
getCookie
(
request
,
"csrf"
);
String
csrfParam
=
ParamUtils
.
getParameter
(
request
,
"csrf"
);
boolean
csrfStatus
=
true
;
if
(
update
)
{
if
(
csrfCookie
==
null
||
csrfParam
==
null
||
!
csrfCookie
.
getValue
().
equals
(
csrfParam
))
{
update
=
false
;
errors
.
put
(
"csrf"
,
"CSRF Failure!"
);
errors
.
put
(
"csrf"
,
"csrf"
);
csrfStatus
=
false
;
}
}
csrfParam
=
StringUtils
.
randomString
(
16
);
...
...
@@ -163,6 +165,22 @@
</td></tr>
</tbody>
</table>
</div><br>
<%
}
else
if
(
csrfStatus
==
false
)
{
%>
<div
class=
"jive-error"
>
<table
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
>
<tbody>
<tr><td
class=
"jive-icon"
><img
src=
"images/error-16x16.gif"
width=
"16"
height=
"16"
border=
"0"
alt=
""
></td>
<td
class=
"jive-icon-label"
>
<fmt:message
key=
"global.csrf.failed"
/>
</td></tr>
</tbody>
</table>
</div><br>
<%
...
...
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