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
Published: 2026-04-17
Score: 7 High
EPSS: < 1% Very Low
KEV: No
Impact: Cross‑Site Request Forgery leading to unauthorized state changes
Action: Apply Patch
AI Analysis

Impact

PAC4J is vulnerable to a Cross‑Site Request Forgery (CSRF) flaw that allows an attacker to create a malicious web page which automatically submits a forged request to a target application. By exploiting a collision in Java’s deterministic String.hashCode() function, the attacker can generate a token whose hash matches the victim’s legitimate CSRF token without knowing the token itself, effectively reducing the token space to 32 bits. This enables the attacker to trigger profile updates, password changes, account linkage, and other state‑changing operations without the user’s consent.

Affected Systems

PAC4J versions earlier than 5.7.10 and 6.4.1 are affected. The vulnerability has been addressed in PAC4J 5.7.10 and 6.4.1, so all users running older releases are at risk.

Risk and Exploitability

The CVSS score is 7 indicating a high severity level, and the exploitability is high because the attacker does not need to learn the victim’s token. The EPSS score is not available, and the vulnerability has not been listed in the CISA KEV catalog. The attack vector is a load‑time CSRF where the attacker delivers a harbored payload to an authenticated user, causing the user’s browser to submit a forged request with a colliding token. The deterministic nature of the hashing function is the key exploitable condition.

Generated by OpenCVE AI on April 18, 2026 at 09:18 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade PAC4J to version 5.7.10 or newer.
  • If upgrading to 6.4.1, verify that the application’s configuration and authentication flows remain compatible.
  • If an immediate upgrade is not possible, disable the CSRF protection or replace the deterministic token generation until a patched version is deployed.

Generated by OpenCVE AI on April 18, 2026 at 09:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-xw5c-jc7x-gf75 PAC4J has a Cross-Site Request Forgery (CSRF) Vulnerability
History

Mon, 20 Apr 2026 14:45:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:pac4j:pac4j:*:*:*:*:*:*:*:*
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N'}


Fri, 17 Apr 2026 15:00:00 +0000

Type Values Removed Values Added
First Time appeared Pac4j
Pac4j pac4j
Vendors & Products Pac4j
Pac4j pac4j

Fri, 17 Apr 2026 14:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 17 Apr 2026 13:45:00 +0000

Type Values Removed Values Added
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
Title Cross-Site Request Forgery in PAC4J
Weaknesses CWE-352
References
Metrics cvssV4_0

{'score': 7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: CERT-PL

Published:

Updated: 2026-04-17T14:00:04.811Z

Reserved: 2026-04-13T10:06:07.141Z

Link: CVE-2026-40458

cve-icon Vulnrichment

Updated: 2026-04-17T13:59:26.592Z

cve-icon NVD

Status : Analyzed

Published: 2026-04-17T14:16:33.987

Modified: 2026-04-20T14:41:43.753

Link: CVE-2026-40458

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T09:30:25Z

Weaknesses