CVE-2026-40458 Cross-Site Request Forgery in PAC4J
Attackers can bypass CSRF protection via hash collisions to perform unauthorized state-changing actions like password changes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-40458?
CVE-2026-40458 is a high-severity vulnerability in PAC4J, published on 17 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
PAC4J is vulnerable to Cross-Site Request Forgery (CSRF). A malicious attacker can craft a specially designed website which, when visited by a user, will automatically submit a forged cross-site request with a token whose hash collides with the victim's legitimate CSRF token. Importantly, the attacker does not need to know the victim’s CSRF token or its hash prior to the attack. Collisions in the deterministic String.hashCode() function can be computed directly, reducing the effective token's security space to 32 bits. This bypasses CSRF protection, allowing profile updates, password changes, account linking, and any other state-changing operations to be performed without the victim's consent.
This issue was fixed in PAC4J versions 5.7.10 and 6.4.1
Weakness: CWE-352
Which versions are affected by CVE-2026-40458?
4 open source packages ship an affected version, including org.pac4j:pac4j-core. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.pac4j:pac4j-core Maven | All versions | 5.7.10 |
org.pac4j:pac4j-core Maven | All versions | 5.7.10 |
org.pac4j:pac4j-core Maven | From 6.0.0-RC1 | 6.4.1 |
org.pac4j:pac4j-core Maven | From 6.0.0-RC1 | 6.4.1 |
Products include Pac4j Pac4j.
How do I fix CVE-2026-40458?
Upgrade org.pac4j:pac4j-core to a fixed version for your release line: 5.7.10 or 6.4.1.
Is CVE-2026-40458 being exploited?
There is no known exploitation of CVE-2026-40458 in the wild and no public exploit code.
Other vulnerabilities in PAC4J
Sources
Also known as ECHO-1c01-a9c0-c59f, GHSA-xw5c-jc7x-gf75, MINI-mpvc-87fh-fqhw, MINI-p499-66xw-gw5w.