CVE-2026-40458
Received
Received - Intake
CSRF Token Hash Collision in PAC4J Enables Unauthorized Actions
Publication date: 2026-04-17
Last updated on: 2026-04-20
Assigner: CERT.PL
Description
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
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| pac4j | pac4j | From 6.0.0 (exc) to 6.4.1 (exc) |
| pac4j | pac4j | From 5.0.0 (inc) to 5.7.10 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-352 | The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. |