Vulnerabilities in pkg:maven/org.pac4j/pac4j-core

PACKAGE
Advisory Identifier: GHSA-xw5c-jc7x-gf75
Advisory Summary

CVE-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.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.pac4j/pac4j-core

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.pac4j/pac4j-core. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-xw5c-jc7x-gf75 CVE-2026-40458 HIGH PAC4J has a Cross-Site Request Forgery (CSRF) Vulnerability
GHSA-76mw-6p95-x9x5 CVE-2023-25581 CRITICAL pac4j-core affected by a Java deserialization vulnerability

CVE-2026-40458 at a Glance

CVE Identifier CVE-2026-40458
GHSA Identifier GHSA-xw5c-jc7x-gf75
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Pac4j core
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (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.

org.pac4j:pac4j-core fixed: 5.7.10
<dependency>
    <groupId>org.pac4j</groupId>
    <artifactId>pac4j-core</artifactId>
    <version>5.7.10</version>
</dependency>
org.pac4j:pac4j-core fixed: 6.4.1
<dependency>
    <groupId>org.pac4j</groupId>
    <artifactId>pac4j-core</artifactId>
    <version>6.4.1</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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.

CVE-2026-40458 Affected Pac4j core Versions

2 component(s)
Fixed Versions:
5.7.106.4.1
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?
CVE-2026-40458 is a security vulnerability in Pac4j core involving PAC4J has a Cross-Site Request Forgery (CSRF) Vulnerability under CWE-352: Cross-Site Request Forgery (CSRF).
Which Pac4j core versions are affected?
Affected versions include releases prior to 5.7.10, 6.4.1 across affected packages: org.pac4j:pac4j-core.
What version fixes CVE-2026-40458?
Upgrading to 5.7.10, 6.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pac4j-core affected?
Yes, org.pac4j:pac4j-core is affected in releases prior to 5.7.10, 6.4.1. Upgrade your dependency to 5.7.10, 6.4.1 or later.
What is the CVSS score of CVE-2026-40458?
CVE-2026-40458 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-40458?
CVE-2026-40458 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (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.).
How can I check Maven dependencies for CVE-2026-40458?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.pac4j'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}