Summary
Cryptographically weak CSRF tokens in Apache MyFaces
In the default configuration, Apache MyFaces Core versions 2.2.0 to 2.2.13, 2.3.0 to 2.3.7, 2.3-next-M1 to 2.3-next-M4, and 3.0.0-RC1 use cryptographically weak implicit and explicit cross-site request forgery (CSRF) tokens. Due to that limitation, it is possible (although difficult) for an attacker to calculate a future CSRF token value and to use that value to trick a user into executing unwanted actions on an application.
Mitigation:
Existing web.xml configuration parameters can be used to direct
MyFaces to use SecureRandom for CSRF token generation:
org.apache.myfaces.RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN=secureRandom
org.apache.myfaces.RANDOM_KEY_IN_CSRF_SESSION_TOKEN=secureRandom
org.apache.myfaces.RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN=secureRandom
Impact
Security-sensitive operations rely on values that are predictable or insufficiently random. Typical impact: forged tokens, guessable identifiers, or broken cryptographic protocols.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
org.apache.myfaces.core:myfaces-core-module to 2.0.25 or later; org.apache.myfaces.core:myfaces-core-module to 2.1.19 or later; org.apache.myfaces.core:myfaces-core-module to 2.2.14 or later; org.apache.myfaces.core:myfaces-core-module to 2.3.8 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2021-26296? CVE-2021-26296 is a high-severity use of insufficiently random values vulnerability in org.apache.myfaces.core:myfaces-core-module (maven), affecting versions < 2.0.25. It is fixed in 2.0.25, 2.1.19, 2.2.14, 2.3.8. Security-sensitive operations rely on values that are predictable or insufficiently random.
- Which versions of org.apache.myfaces.core:myfaces-core-module are affected by CVE-2021-26296? org.apache.myfaces.core:myfaces-core-module (maven) versions < 2.0.25 is affected.
- Is there a fix for CVE-2021-26296? Yes. CVE-2021-26296 is fixed in 2.0.25, 2.1.19, 2.2.14, 2.3.8. Upgrade to this version or later.
- Is CVE-2021-26296 exploitable, and should I be worried? Whether CVE-2021-26296 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2021-26296 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2021-26296?
- Upgrade
org.apache.myfaces.core:myfaces-core-moduleto 2.0.25 or later - Upgrade
org.apache.myfaces.core:myfaces-core-moduleto 2.1.19 or later - Upgrade
org.apache.myfaces.core:myfaces-core-moduleto 2.2.14 or later - Upgrade
org.apache.myfaces.core:myfaces-core-moduleto 2.3.8 or later
- Upgrade