Vulnerability · Published May 3, 2025 · Assigned by CPANSec

CVE-2024-58135Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default

Medium 5.3

In plain English

A medium-severity security flaw in Mojolicious from SRI. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 48% of all known vulnerabilities).

Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)0.6%top 52.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12libmojolicious-perlno fix listedDEBIAN-CVE-2024-58135
Debian:13libmojolicious-perlno fix listedDEBIAN-CVE-2024-58135
Debian:14libmojolicious-perlno fix listedDEBIAN-CVE-2024-58135
Ubuntu:22.04:LTSlibmojolicious-perlno fix listedUBUNTU-CVE-2024-58135
Ubuntu:24.04:LTSlibmojolicious-perlno fix listedUBUNTU-CVE-2024-58135
Ubuntu:25.10libmojolicious-perlno fix listedUBUNTU-CVE-2024-58135
Ubuntu:26.04:LTSlibmojolicious-perlno fix listedUBUNTU-CVE-2024-58135
Ubuntu:26.10libmojolicious-perlno fix listedUBUNTU-CVE-2024-58135

Affected products (as reported)

VendorProductVersions
SRI Mojolicious 7.28 – through 9.45

Weakness: CWE-338 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

References