CVE-2026-40458: Pac4j core PAC4J Has A Cross-Site Request Vulnerability
HIGHCVE-2026-40458 is a HIGH (CVSS 6.5) pac4j has a cross-site request vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Pac4j core libraries in the Maven ecosystem. The issue involves pac4j has a cross-site request forgery (csrf) vulnerability. Remediation is available by upgrading affected packages to version 5.7.10, 6.4.1.
CVE-2026-40458 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-40458
To remediate this vulnerability, upgrade all affected Pac4j core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-core</artifactId>
<version>5.7.10</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-core</artifactId>
<version>6.4.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.pac4j
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2026-40458, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.pac4j
Analyze the terminal output to locate any version of Pac4j core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.7.10), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.pac4j command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where 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. In Pac4j core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-40458 Affected Pac4j core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.pac4j:pac4j-core
|
Maven |
< 5.7.10
|
5.7.10
|
|
org.pac4j:pac4j-core
|
Maven |
≥ 6.0.0-RC1
< 6.4.1
|
6.4.1
|
References
Frequently Asked Questions
What is CVE-2026-40458?
Which Pac4j core versions are affected?
What version fixes CVE-2026-40458?
Is pac4j-core affected?
What is the CVSS score of CVE-2026-40458?
What CWE is associated with CVE-2026-40458?
How can I check Maven dependencies for CVE-2026-40458?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xw5c-jc7x-gf75",
"modified" : "2026-04-24T20:59:38Z",
"published" : "2026-04-17T15:31:18Z",
"aliases" : [ "CVE-2026-40458" ],
"summary" : "PAC4J has a Cross-Site Request Forgery (CSRF) Vulnerability",
"details" : "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.\n\nThis issue was fixed in PAC4J versions 5.7.10 and 6.4.1.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.pac4j:pac4j-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.7.10"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.pac4j:pac4j-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0-RC1"
}, {
"fixed" : "6.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40458"
}, {
"type" : "WEB",
"url" : "https://cert.pl/en/posts/2026/04/CVE-2026-40458"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pac4j/pac4j"
}, {
"type" : "WEB",
"url" : "https://www.pac4j.org/blog/security-advisory-pac4j-core-and-ldap.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-352" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-18T01:04:38Z",
"nvd_published_at" : "2026-04-17T14:16:33Z"
}
}