CVE-2023-25581
pac4j-core affected by a Java deserialization vulnerability
Severity by source
Trivy's own label is CRITICAL. Rated critical by GHSA.
Description
pac4j is a security framework for Java. `pac4j-core` prior to version 4.0.0 is affected by a Java deserialization vulnerability. The vulnerability affects systems that store externally controlled values in attributes of the `UserProfile` class from pac4j-core. It can be exploited by providing an attribute that contains a serialized Java object with a special prefix `{#sb64}` and Base64 encoding. This issue may lead to Remote Code Execution (RCE) in the worst case. Although a `RestrictedObjectInputStream` is in place, that puts some restriction on what classes can be deserialized, it still allows a broad range of java packages and potentially exploitable with different gadget chains. pac4j versions 4.0.0 and greater are not affected by this issue. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| maven::GitHub Security Advisory Maven | org.pac4j:pac4j-core | 4.0.0 |
References
- https://github.com/frohoff/ysoserial
- https://github.com/pac4j/pac4j
- https://github.com/pac4j/pac4j/blob/5834aeb22ad3a4369dfa572be60d7b20f5784a8f/pac4j-core/src/main/java/org/pac4j/core/profile/InternalAttributeHandler.java#L95
- https://nvd.nist.gov/vuln/detail/CVE-2023-25581
- https://portswigger.net/web-security/deserialization
- https://securitylab.github.com/advisories
- https://securitylab.github.com/advisories/GHSL-2022-085_pac4j
- https://securitylab.github.com/advisories/GHSL-2022-085_pac4j/