Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. org.pac4j/pac4j-core
  4. ›
  5. CVE-2026-40458

CVE-2026-40458: PAC4J has a Cross-Site Request Forgery (CSRF) Vulnerability

April 17, 2026 (updated April 24, 2026)

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.

References

  • cert.pl/en/posts/2026/04/CVE-2026-40458
  • github.com/advisories/GHSA-xw5c-jc7x-gf75
  • github.com/pac4j/pac4j
  • nvd.nist.gov/vuln/detail/CVE-2026-40458
  • www.pac4j.org/blog/security-advisory-pac4j-core-and-ldap.html

Code Behaviors & Features

Detect and mitigate CVE-2026-40458 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.7.10, all versions starting from 6.0.0-RC1 before 6.4.1

Fixed versions

  • 5.7.10
  • 6.4.1

Solution

Upgrade to versions 5.7.10, 6.4.1 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-352: Cross-Site Request Forgery (CSRF)

Source file

maven/org.pac4j/pac4j-core/CVE-2026-40458.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:17:41 +0000.