# PAC4J CSRF and LDAP injection flaws fixed

Published: 2026-04-17 · Severity: medium · Sectors: technology
Canonical: https://vorant.io/reports/dfb5f401-cfe2-5b8a-af45-1d0f7be94e2b/pac4j-csrf-and-ldap-injection-flaws-fixed

> Two vulnerabilities in PAC4J allow CSRF token collision bypass and LDAP injection, both patched in updated releases.

CERT Polska coordinated disclosure of two vulnerabilities in PAC4J, a Java security framework used for authentication and authorization. CVE-2026-40458 is a CSRF weakness stemming from PAC4J's use of the deterministic String.hashCode() function to generate CSRF tokens, reducing the effective token security space to only 32 bits. An attacker can precompute hash collisions without ever needing to see the victim's actual token, then craft a malicious site that auto-submits a forged request matching the victim's token hash, enabling unauthorized profile updates, password changes, and account linking.

CVE-2026-40459 is an LDAP injection vulnerability affecting multiple ID-based search methods in PAC4J, allowing a low-privileged remote attacker to inject crafted LDAP syntax and perform unauthorized directory queries or operations. Both issues were responsibly reported by Bartłomiej Dmitruk of striga.ai and have been fixed by the PAC4J maintainers: CVE-2026-40458 in versions 5.7.10 and 6.4.1, and CVE-2026-40459 in versions 4.5.10, 5.7.10, and 6.4.1. There is no indication of active exploitation; organizations using PAC4J should upgrade to the patched versions.

## Mentioned in this report

- Vulnerabilities: CVE-2026-40458, CVE-2026-40459

Source reporting: https://cert.pl/en/posts/2026/04/CVE-2026-40458

---

This is the free public brief from Vorant Threat Intelligence. When citing, attribute "Vorant" and link https://vorant.io/reports/dfb5f401-cfe2-5b8a-af45-1d0f7be94e2b/pac4j-csrf-and-ldap-injection-flaws-fixed.
Full IOC sets, deployable detections, the entity graph, TAXII 2.1 feed and real-time alerts: https://vorant.io/signup
