Deserialization of untrusted data in InternalAttributeHandler in pac4j
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2023-25581
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 09:09 UTC · Revision 1
Source evidence
Deserialization of untrusted data in InternalAttributeHandler in pac4j
core-osv · Original sourcePublished 10 Oct 2024, 15:49 UTC
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.
osv:CVE-2023-25581
Complete source record
{
"id": "bdaf42cb383451c8789ebd3b42d4578cfe202ce3260f1b56207282d9baa64498",
"url": "https://osv.dev/vulnerability/CVE-2023-25581",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Deserialization of untrusted data in InternalAttributeHandler in pac4j",
"summary": "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.",
"evidence": "osv:CVE-2023-25581",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2023-25581",
"aliases": [
"CVE-2023-25581",
"GHSA-76mw-6p95-x9x5"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/pac4j/pac4j",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "332a4f2d38015495108b225a3f7353a165969f90"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "4.0.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"range": [
{
"introduced": "0"
},
{
"fixed": "4.0.0"
}
],
"source": "DESCRIPTION"
}
]
}
}
],
"versions": [
"pac4j-4.0.0-RC3",
"pac4j-4.0.0-RC2",
"pac4j-4.0.0-RC1",
"pac4j-3.4.0",
"pac4j-3.3.0",
"pac4j-3.2.0",
"pac4j-3.1.0",
"pac4j-3.0.1",
"pac4j-3.0.0",
"pac4j-3.0.0-RC2",
"pac4j-3.0.0-RC1",
"pac4j-2.1.0",
"pac4j-2.0.0",
"pac4j-2.0.0-RC2",
"pac4j-2.0.0-RC1",
"pac4j-1.9.3",
"pac4j-1.9.2",
"pac4j-1.9.1",
"pac4j-1.9.0",
"pac4j-1.8.3",
"pac4j-1.8.2",
"pac4j-1.8.1",
"pac4j-1.8.0",
"pac4j-1.8.0-RC1",
"pac4j-1.7.0",
"pac4j-1.6.0",
"pac4j-1.6.0-RC1",
"pac4j-1.5.1",
"pac4j-1.5.0",
"pac4j-1.4.1",
"pac4j-1.4.0",
"scribe-up-1.3.1",
"scribe-up-1.3.0",
"scribe-up-1.1.0",
"scribe-up-1.0.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-25581.json"
}
}
],
"modified": "2026-10-28T02:30:34.391944013Z",
"provider": "osv",
"references": [
"https://github.com/pac4j/pac4j/blob/5834aeb22ad3a4369dfa572be60d7b20f5784a8f/pac4j-core/src/main/java/org/pac4j/core/profile/InternalAttributeHandler.java#L95",
"https://portswigger.net/web-security/deserialization",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/25xxx/CVE-2023-25581.json",
"https://nvd.nist.gov/vuln/detail/CVE-2023-25581",
"https://securitylab.github.com/advisories/GHSL-2022-085_pac4j/",
"https://github.com/frohoff/ysoserial"
],
"provider_metadata": {
"cwe_ids": [
"CWE-502"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/25xxx/CVE-2023-25581.json"
}
},
"related_cves": [
{
"value": "CVE-2023-25581",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 501345,
"published_at": "2024-10-10T15:49:28.316+00:00"
}