What’s Vulnerable › Vulnerabilities
CVE-2026-40458: Cross-Site Request Forgery in PAC4J
- Severity: medium (CVSS 6.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-04-17 · updated 2026-06-17
- Weakness: CWE-352
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
Affected products
- pac4j: from 5.0.0 before 5.7.10; from 6.0.0 (excl.) before 6.4.1 — fixed in 5.7.10, 6.4.1
How to fix
Upgrade to a fixed version: pac4j 5.7.10, 6.4.1. Check the vendor advisory for mitigations.
References
- https://cert.pl/en/posts/2026/04/CVE-2026-40458/
- https://www.pac4j.org/blog/security-advisory-pac4j-core-and-ldap.html
Get alerted when CVE-2026-40458 or the next vulnerability affects your stack