CVE-2016-4430: Apache Struts CSRF Vulnerability
Summary
CVE-2016-4430: Apache Struts CSRF Vulnerability. Affects org.apache.struts.xwork:xwork-core versions >= 2.3.20, < 2.3.29. Fixed in 2.3.29. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Apache Struts is an open-source framework for developing Java web applications. It provides a set of reusable components and a MVC (Model-View-Controller) architecture. The vulnerability identified as CVE-2016-4430 affects Apache Struts versions 2.3.20 through 2.3.28.1. This vulnerability specifically relates to token validation, which is mishandled, allowing remote attackers to conduct cross-site request forgery (CSRF) attacks. CSRF attacks can lead to unauthorized actions being performed on behalf of authenticated users, potentially resulting in data breaches, unauthorized access, or other malicious activities.
Vulnerability Detail
The vulnerability in Apache Struts 2 2.3.20 through 2.3.28.1 arises from the mishandling of token validation. This allows remote attackers to exploit the application's lack of proper CSRF protection and perform unauthorized actions on behalf of authenticated users. The specific vectors through which the attack can be carried out are unspecified. However, it is important to note that CSRF attacks can have severe consequences, including data manipulation, unauthorized access, and potential compromise of sensitive information.
How To Fix
Latest published version: 2.3.37 as of 23 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.3.29
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading the Apache Struts package is not immediately feasible, a possible workaround is to implement CSRF protection manually. This can be achieved by generating and validating unique tokens for each user session and including them in all requests that modify state or perform sensitive actions. The tokens should be securely stored and verified on the server-side to prevent CSRF attacks. Here is an example of how to implement CSRF protection using the OWASP Java Encoder library:
import org.owasp.encoder.Encode;
public class CsrfUtils {
public static String generateToken() {
// Generate a unique token for the current user session
String token = /* Generate token logic */;
return Encode.forHtmlAttribute(token);
}
public static boolean validateToken(String token) {
// Validate the token against the stored value for the current user session
String storedToken = /* Retrieve stored token logic */;
return token.equals(storedToken);
}
}
Conclusion
The Apache Struts CSRF vulnerability (CVE-2016-4430) is a high-severity vulnerability that allows remote attackers to conduct CSRF attacks on affected applications. To mitigate this vulnerability, it is crucial to upgrade the Apache Struts package to a version beyond 2.3.28.1 or implement CSRF protection manually. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.struts.xwork:xwork-core →
FAQ
Apache Struts is an open-source framework for developing Java web applications. It provides a set of reusable components and a MVC (Model-View-Controller) architecture.
CSRF (Cross-Site Request Forgery) is a type of attack where a malicious website tricks a user's browser into performing an unwanted action on a different website where the user is authenticated.
CSRF attacks can lead to unauthorized actions being performed on behalf of authenticated users, potentially resulting in data breaches, unauthorized access, or other malicious activities.
To fix this vulnerability, it is recommended to upgrade the Apache Struts package to a version beyond 2.3.28.1. Alternatively, you can implement CSRF protection manually by generating and validating unique tokens for each user session.
If upgrading the Apache Struts package is not immediately feasible, a possible workaround is to implement CSRF protection manually by generating and validating unique tokens for each user session.
Related vulnerabilities
Recent vulnerabilities recorded for org.apache.struts.xwork:xwork-core.