Skip to content

jooby-pac4j: deserialization of untrusted data

High severity GitHub Reviewed Published Mar 31, 2025 in jooby-project/jooby • Updated Apr 1, 2025

Package

maven io.jooby:jooby-pac4j (Maven)

Affected versions

< 2.17.0
>= 3.0.0.M1, < 3.7.0

Patched versions

2.17.0
3.7.0

Description

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

Here's a small demo using SessionStoreImpl#get to handle sessions ,and user can pass parameters.

屏幕截图 2025-03-25 051325

And following below is exploiting successfully(execute calculator)

屏幕截图 2025-03-24 015128(1)

References

@jknack jknack published to jooby-project/jooby Mar 31, 2025
Published by the National Vulnerability Database Mar 31, 2025
Published to the GitHub Advisory Database Apr 1, 2025
Reviewed Apr 1, 2025
Last updated Apr 1, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(10th percentile)

Weaknesses

CVE ID

CVE-2025-31129

GHSA ID

GHSA-7c5v-895v-w4q5

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.