CVE-2024-58135 Details
Description
Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default. When creating a default app skeleton with the "mojo generate app" tool, a weak secret is written to the application's configuration file using the insecure rand() function, and used for authenticating and protecting the integrity of the application's sessions. This may allow an attacker to brute force the application's session keys. Release 9.46 fixes the issue by providing high quality randomness, even in absence of CryptX. Users should be aware that the update does not replace previously generated weak secrets. A secret generated with the previous version MUST be replaced to ensure the updated version is using a strong secret.
A vulnerability exists in Mojolicious versions 7.28 through 9.40 for Perl, where the framework generates weak HMAC session secrets. The issue arises because the default application generator uses the insecure rand() function to create a secret that is then saved in the application's configuration file. This weak secret is used to authenticate and ensure the integrity of session data, potentially allowing attackers to brute-force session keys.
Users can manually set a strong session secret in their application's configuration file. It is recommended to use a secret generated from a cryptographically secure random number generator, such as those provided by the Crypt::Random or Crypt::URandom modules.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 5, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | CISA-ADP |
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| mojolicious mojolicious | >= 7.28, <= 9.40 |
CPE
Remediation
| |
Change History
8 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | CPANSec |
| Jun 5, 2026 | CVE Modified | CPANSec |
| Oct 20, 2025 | CVE Modified | CPANSec |
| Jun 17, 2025 | Initial Analysis | [email protected] |
| May 12, 2025 | CVE Modified | CPANSec |
| May 7, 2025 | CVE Modified | CISA-ADP |
| May 3, 2025 | New CVE Received | CPANSec |