Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F14018094 for ; Tue, 1 Sep 2015 08:52:46 +0000 (UTC) Received: (qmail 6329 invoked by uid 500); 1 Sep 2015 08:52:46 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 6290 invoked by uid 500); 1 Sep 2015 08:52:46 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 6274 invoked by uid 99); 1 Sep 2015 08:52:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2015 08:52:45 +0000 Date: Tue, 1 Sep 2015 08:52:45 +0000 (UTC) From: "Yasser Zamani (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (WW-4539) Handling array of tokens in token session interceptor to prevent CSRF attack in an async-request app MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14724977#comment-14724977 ] Yasser Zamani edited comment on WW-4539 at 9/1/15 8:51 AM: ----------------------------------------------------------- Thank you! I did nothing so far to attach :( I have to do this for our application and if you think this works, then I start to implement this similar to Strut's TokenSessionStoreInterceptor and will attach the work here. Do you have any advice? But another issue is that I cannot modify Struts source code itself and attach the patch here, because our application user cannot wait for struts release and also our maven project get Struts jar files from internet always not my modified version. What do contributors do in such situation? Thanks in advance! was (Author: yasser.zamani): Thank you! I did nothing so far to attach :( I have to do this for our application and if you think this works, then I start to implement this similar to Strut's TokenSessionStoreInterceptor and will attach the work here. Do you have any advice? > Handling array of tokens in token session interceptor to prevent CSRF attack in an async-request app > ---------------------------------------------------------------------------------------------------- > > Key: WW-4539 > URL: https://issues.apache.org/jira/browse/WW-4539 > Project: Struts 2 > Issue Type: Improvement > Components: Core Interceptors > Affects Versions: Future > Reporter: Yasser Zamani > Priority: Trivial > Labels: security > Fix For: 2.3.x > > > We have an application based on Struts2 which may call multiple async actions via JQuery AJAX post or form post. To prevent this application from CSRF attacks I'm going to write my own interceptor which is very similar to Struts2 token session interceptor. But this one holds an array of valid tokens instead of one token to enable user to have async multiple requests with different valid token for each one. i.e. my own token TAG will generate different tokens in each inclusion even in one JSP and thread. So, different part of JSP can have their own async requests with valid tokens. Each token will be removed from array when corresponded request has finished. > I decided to share my work to you for two reasons: > 1. Maybe you are interested too to have this feature in Struts core. > 2. To get your feedback if this solution works to prevent CSRF attacks. I just copy from token session interceptor and current token tag in Struts core but still I'm wory about thread safety of my work or any other issue. > Thanks in advance! -- This message was sent by Atlassian JIRA (v6.3.4#6332)