CVE-2026-40458 Cross-Site Request Forgery in PAC4J

High 7.0 Published Updated

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.

PackageAffectedFixed in
org.pac4j:pac4j-core MavenAll versions5.7.10
org.pac4j:pac4j-core MavenAll versions5.7.10
org.pac4j:pac4j-core MavenFrom 6.0.0-RC16.4.1
org.pac4j:pac4j-core MavenFrom 6.0.0-RC16.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.

Sources

Also known as ECHO-1c01-a9c0-c59f, GHSA-xw5c-jc7x-gf75, MINI-mpvc-87fh-fqhw, MINI-p499-66xw-gw5w.

Is CVE-2026-40458 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free