Cross-Site Request Forgery (CSRF) Prevention
Using Struts 2
Perform CSRF prevention using
Struts 2 within an application.
Objectives
CSRF prevention is a key security control for an application
that protects the application and its users from CSRF attacks. This article
will describe how to use the built-in mechanisms provided by Struts 2 to
perform CSRF prevention.
Code Example
There is a standard model for CSRF prevention using Struts 2
that involves 3 basic steps
1. Update your interceptor stack to include the tokenSessionInterceptor ,
either including or excluding all methods (all are included here).
*
2. Update your action configuration to include or exclude any
methods that need or do not need CSRF protection
1. Update your interceptor stack to include the
*
No comments:
Post a Comment