{"id":"CVE-2023-25581","aliases":["CVE-2023-25581","GHSA-76mw-6p95-x9x5"],"related":[],"kind":"vulnerability","state":"published","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"pac4j es un framework de seguridad para Java. `pac4j-core` anterior a la versión 4.0.0 se ve afectado por una vulnerabilidad de deserialización de Java. La vulnerabilidad afecta a los sistemas que almacenan valores controlados externamente en atributos de la clase `UserProfile` de pac4j-core. Se puede explotar proporcionando un atributo que contenga un objeto Java serializado con un prefijo especial `{#sb64}` y codificación Base64. Este problema puede provocar la ejecución remota de código (RCE) en el peor de los casos. Aunque existe un `RestrictedObjectInputStream`, que impone algunas restricciones sobre qué clases se pueden deserializar, aún permite una amplia gama de paquetes de Java y es potencialmente explotable con diferentes cadenas de gadgets. Las versiones 4.0.0 y posteriores de pac4j no se ven afectadas por este problema. Se recomienda a los usuarios que actualicen. No existen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2024-10-10T15:49:28.316Z","modified":"2026-06-17T05:41:32.250Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.2,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.2,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"CRITICAL"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"version":"< 4.0.0","status":"affected"}],"vendor":"pac4j","product":"pac4j","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"4.0.0","status":"affected"}],"vendor":"pac4j","product":"pac4j","cpe":"cpe:2.3:a:pac4j:pac4j:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.0.0"}],"ecosystem":"Maven","package":"org.pac4j:pac4j-core","purl":"pkg:maven/org.pac4j/pac4j-core","source":"ghsa"}],"references":[{"url":"https://securitylab.github.com/advisories/GHSL-2022-085_pac4j/","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/frohoff/ysoserial","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/pac4j/pac4j/blob/5834aeb22ad3a4369dfa572be60d7b20f5784a8f/pac4j-core/src/main/java/org/pac4j/core/profile/InternalAttributeHandler.java#L95","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://portswigger.net/web-security/deserialization","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-25581","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pac4j/pac4j","tags":["package"],"sources":["ghsa"]},{"url":"https://securitylab.github.com/advisories","tags":["web"],"sources":["ghsa"]},{"url":"https://securitylab.github.com/advisories/GHSL-2022-085_pac4j","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2024-10-10T16:07:56.535Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-25581","url":"https://www.cve.org/CVERecord?id=CVE-2023-25581","licence":"CVE Terms of Use","modified":"2024-10-10T16:08:30.517Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-76mw-6p95-x9x5","url":"https://github.com/advisories/GHSA-76mw-6p95-x9x5","licence":"CC-BY-4.0","modified":"2024-10-14T18:44:38.309Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-25581","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-25581","licence":"Public domain","modified":"2026-06-17T05:41:32.250Z"}],"updatedAt":"2026-11-25T22:58:34.331Z","epss":{"score":0.01936,"percentile":0.80668,"date":"2026-12-01T12:00:22.000Z"}}