CVE-2025-31129: jooby-pac4j Deserialization Of Untrusted Data Vulnerability

HIGH
Advisory Identifier: GHSA-7c5v-895v-w4q5
CVSS 8.8
CWE-502
Published
Advisory Summary

CVE-2025-31129 is a HIGH (CVSS 8.8) deserialization of untrusted data vulnerability (CWE-502: Deserialization of Untrusted Data) affecting jooby-pac4j libraries in the Maven ecosystem. The issue involves deserialization of untrusted data. Remediation is available by upgrading affected packages to version 2.17.0, 3.7.0.

CVE-2025-31129 at a Glance

CVE Identifier CVE-2025-31129
GHSA Identifier GHSA-7c5v-895v-w4q5
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product jooby-pac4j
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-31129

To remediate this vulnerability, upgrade all affected jooby-pac4j dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.jooby:jooby-pac4j fixed: 2.17.0
<dependency>
    <groupId>io.jooby</groupId>
    <artifactId>jooby-pac4j</artifactId>
    <version>2.17.0</version>
</dependency>
io.jooby:jooby-pac4j fixed: 3.7.0
<dependency>
    <groupId>io.jooby</groupId>
    <artifactId>jooby-pac4j</artifactId>
    <version>3.7.0</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=io.jooby

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2025-31129, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.jooby

Analyze the terminal output to locate any version of jooby-pac4j in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.17.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.jooby 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In jooby-pac4j, 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

### Impact Versions after 2.x and before 3.x of io.jooby:jooby-pac4j can cause deserialization of untrusted data ### Patches - 2.17.0 (2.x) - 3.7.0 (3.x) ### Workarounds - Not using io.jooby:jooby-pac4j until it gets patches. - Check what values you put/save on session ### References Version 2.x: https://github.com/jooby-project/jooby/blob/v2.x/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L39-L45 Version 3.x: https://github.com/jooby-project/jooby/blob/v3.6.1/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L77-L84 ### Cause In module pac4j io.jooby.internal.pac4j.SessionStoreImpl#get , it is used to handle sessions , and trying to get key value. In strToObject function ,it's trying to deserialize value when value starts with "b64~" , which might cause deserialization of untrusted data. [modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java](https://github.com/jooby-project/jooby/blob/v3.6.1/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L77-L84) Here's a small demo using SessionStoreImpl#get to handle sessions ,and user can pass parameters. ![屏幕截图 2025-03-25 051325](https://github.com/user-attachments/assets/93039a06-d4f1-458a-8595-736b3fede345) And following below is exploiting successfully(execute calculator) ![屏幕截图 2025-03-24 015128(1)](https://github.com/user-attachments/assets/415cf20c-dda0-4634-83ae-f8fa89677a16)

CVE-2025-31129 Affected jooby-pac4j Versions

2 component(s)
Fixed Versions:
2.17.03.7.0
Product / Package Ecosystem Affected Versions Fixed Version
io.jooby:jooby-pac4j
Maven
< 2.17.0
2.17.0
io.jooby:jooby-pac4j
Maven
≥ 3.0.0.M1
< 3.7.0
3.7.0

References

Frequently Asked Questions

What is CVE-2025-31129?
CVE-2025-31129 is a security vulnerability in jooby-pac4j involving deserialization of untrusted data under CWE-502: Deserialization of Untrusted Data.
Which jooby-pac4j versions are affected?
Affected versions include releases prior to 2.17.0, 3.7.0 across affected packages: io.jooby:jooby-pac4j.
What version fixes CVE-2025-31129?
Upgrading to 2.17.0, 3.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jooby-pac4j affected?
Yes, io.jooby:jooby-pac4j is affected in releases prior to 2.17.0, 3.7.0. Upgrade your dependency to 2.17.0, 3.7.0 or later.
What is the CVSS score of CVE-2025-31129?
CVE-2025-31129 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-31129?
CVE-2025-31129 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2025-31129?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.jooby'. 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-7c5v-895v-w4q5",
  "modified" : "2025-04-01T14:19:43Z",
  "published" : "2025-04-01T14:19:43Z",
  "aliases" : [ "CVE-2025-31129" ],
  "summary" : "jooby-pac4j: deserialization of untrusted data",
  "details" : "### Impact\n\nVersions after 2.x and before 3.x of io.jooby:jooby-pac4j can cause deserialization of untrusted data\n\n### Patches\n\n- 2.17.0 (2.x)\n- 3.7.0 (3.x)\n\n### Workarounds\n\n- Not using io.jooby:jooby-pac4j until it gets patches.\n- Check what values you put/save on session\n\n### References\n\nVersion 2.x:\n\nhttps://github.com/jooby-project/jooby/blob/v2.x/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L39-L45\n\nVersion 3.x:\nhttps://github.com/jooby-project/jooby/blob/v3.6.1/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L77-L84\n\n### Cause\n\nIn module pac4j io.jooby.internal.pac4j.SessionStoreImpl#get , it is used to handle sessions , and trying to get key value. In strToObject function ,it's trying to deserialize value when value starts with \"b64~\" , which might cause deserialization of untrusted data.\n\n[modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java](https://github.com/jooby-project/jooby/blob/v3.6.1/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L77-L84)\n\nHere's a small demo using SessionStoreImpl#get to handle sessions ,and user can pass parameters.\n\n![屏幕截图 2025-03-25 051325](https://github.com/user-attachments/assets/93039a06-d4f1-458a-8595-736b3fede345)\n\nAnd following below is exploiting successfully(execute calculator)\n\n![屏幕截图 2025-03-24 015128(1)](https://github.com/user-attachments/assets/415cf20c-dda0-4634-83ae-f8fa89677a16)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.jooby:jooby-pac4j"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.17.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.jooby:jooby-pac4j"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0.M1"
      }, {
        "fixed" : "3.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jooby-project/jooby/security/advisories/GHSA-7c5v-895v-w4q5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-31129"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jooby-project/jooby/commit/3e13562cf36d7407813eae464e0f4b598de15692"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jooby-project/jooby"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jooby-project/jooby/blob/v2.x/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L39-L45"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jooby-project/jooby/blob/v3.6.1/modules/jooby-pac4j/src/main/java/io/jooby/internal/pac4j/SessionStoreImpl.java#L77-L84"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-01T14:19:43Z",
    "nvd_published_at" : "2025-03-31T19:15:43Z"
  }
}