Miggo Logo

GHSA-gr7h-xw4f-wh86: Sakai kernel-impl: predictable PRNG used to generate server‑side encryption key in EncryptionUtilityServiceImpl

2.6

CVSS Score
3.1

Basic Information

CVE ID
-
EPSS Score
-
Published
10/22/2025
Updated
10/22/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.sakaiproject.kernel:sakai-kernel-implmaven<= 23.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability, identified as GHSA-gr7h-xw4f-wh86, stems from the use of a predictable Pseudo-Random Number Generator (PRNG) for security-sensitive operations. The analysis of the provided patch commit bde070104b1de01f4a6458dca6d9e0880a0e3c04 confirms this.

The root cause is the usage of org.apache.commons.lang3.RandomStringUtils without providing a cryptographically secure random number generator. By default, this utility uses java.util.Random, which is not suitable for cryptographic purposes as its output can be predicted if an attacker can gather some initial state information.

Two primary vulnerable functions were identified from the patch:

  1. org.sakaiproject.util.impl.EncryptionUtilityServiceImpl.init(): This function is responsible for initializing a server-wide secret key (serverSecretKey) used for encrypting data at rest. The patch explicitly replaces the default RandomStringUtils.random call with one that uses java.security.SecureRandom, a cryptographically strong PRNG. This indicates that the original implementation was vulnerable to key prediction.

  2. org.sakaiproject.component.app.scheduler.jobs.cm.processor.sis.UserProcessor.generatePassword(): This function generates passwords for users, likely during an automated user provisioning process from a Student Information System (SIS). Similar to the first function, it was using a weak version of RandomStringUtils. The patch corrects this by incorporating SecureRandom, mitigating the risk of generating predictable passwords.

An attacker exploiting this vulnerability could potentially decrypt sensitive data or gain unauthorized access to user accounts by predicting the generated keys or passwords. The fix applied in the patch correctly addresses the root cause by replacing the weak PRNG with a secure one for all identified instances.

Vulnerable functions

org.sakaiproject.util.impl.EncryptionUtilityServiceImpl.init
kernel/kernel-impl/src/main/java/org/sakaiproject/util/impl/EncryptionUtilityServiceImpl.java
The `init` method in `EncryptionUtilityServiceImpl` used `RandomStringUtils.random` which defaults to the non-cryptographic `java.util.Random` to generate the `serverSecretKey`. This key is used as the password for an `AES256TextEncryptor`. An attacker who can obtain ciphertexts and approximate the PRNG seed can potentially reconstruct the key and decrypt data.
org.sakaiproject.component.app.scheduler.jobs.cm.processor.sis.UserProcessor.generatePassword
jobscheduler/scheduler-component-shared/src/java/org/sakaiproject/component/app/scheduler/jobs/cm/processor/sis/UserProcessor.java
The `generatePassword` method in `UserProcessor` used `RandomStringUtils.randomAlphanumeric` which defaults to the non-cryptographic `java.util.Random`. This could lead to predictable passwords being generated for users created through the SIS (Student Information System) integration.

WAF Protection Rules

WAF Rule

### Imp**t *n*ryptionUtilityS*rvi**Impl initi*liz** *n **S***T*xt*n*ryptor p*sswor* (s*rv*rS**r*tK*y) usin* R*n*omStrin*Utils wit* t** ****ult j*v*.util.R*n*om. j*v*.util.R*n*om is * non‑*rypto*r*p*i* PRN* *n* **n ** pr**i*t** *rom limit** st*t*/s***

Reasoning

T** vuln*r**ility, i**nti*i** *s **S*-*r**-xw**-w***, st*ms *rom t** us* o* * pr**i*t**l* Ps*u*o-R*n*om Num**r **n*r*tor (PRN*) *or s**urity-s*nsitiv* op*r*tions. T** *n*lysis o* t** provi*** p*t** *ommit `****************************************` *o