mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-4730 Uses session.getId().intern() to properly lock down session
This commit is contained in:
@@ -221,7 +221,8 @@ public class I18nInterceptor extends AbstractInterceptor {
|
||||
Map<String, Object> session = invocation.getInvocationContext().getSession();
|
||||
|
||||
if (session != null) {
|
||||
synchronized (session) {
|
||||
String sessionId = ServletActionContext.getRequest().getSession().getId();
|
||||
synchronized (sessionId.intern()) {
|
||||
session.put(attributeName, locale);
|
||||
}
|
||||
}
|
||||
@@ -293,7 +294,8 @@ public class I18nInterceptor extends AbstractInterceptor {
|
||||
Map<String, Object> session = invocation.getInvocationContext().getSession();
|
||||
|
||||
if (session != null) {
|
||||
synchronized (session) {
|
||||
String sessionId = ServletActionContext.getRequest().getSession().getId();
|
||||
synchronized (sessionId.intern()) {
|
||||
Object sessionLocale = session.get(attributeName);
|
||||
if (sessionLocale != null && sessionLocale instanceof Locale) {
|
||||
Locale locale = (Locale) sessionLocale;
|
||||
|
||||
@@ -145,7 +145,7 @@ public class TokenInterceptor extends MethodFilterInterceptor {
|
||||
//see WW-2902: we need to use the real HttpSession here, as opposed to the map
|
||||
//that wraps the session, because a new wrap is created on every request
|
||||
HttpSession session = ServletActionContext.getRequest().getSession(true);
|
||||
synchronized (session) {
|
||||
synchronized (session.getId().intern()) {
|
||||
if (!TokenHelper.validToken()) {
|
||||
return handleInvalidToken(invocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user