CVE-2024-58135
Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default
Check your servers for CVE-2024-58135
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-58135 affects mojolicious, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality low, integrity none, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.58%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 49.2% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 5 May 2025):
- Exploitation
- poc: a proof of concept is public
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
Mojolicious
package
Mojolicious |
affected from 7.28 up to and including 9.45
Other versions: unaffected
|
Is my server affected?
Find the installed version of mojolicious and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i mojolicious
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2024-58135 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2024-58135RHEL, Rocky, Alma, Fedora
rpm -q mojolicious
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2024-58135Alpine
apk list --installed | grep -i mojoliciousWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-58135
trivy image --scanners vuln IMAGE | grep CVE-2024-58135
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Patches and release notes
- https://metacpan.org/release/SRI/Mojolicious-9.46/source/Changes metacpan.org · release notes
- https://github.com/mojolicious/mojo/commit/fb3733f92cc8a3344e6d615b3c7dac9d538eeab0.patch github.com · patch
- https://github.com/mojolicious/mojo/commit/789cfa43f9118852b38cbd1fd0a2596bcb9821ea.patch github.com · patch
Exploits and proof of concept
- https://github.com/hashcat/hashcat/pull/4090 github.com · exploit
Other references
- https://perldoc.perl.org/functions/rand perldoc.perl.org · related
- https://metacpan.org/release/SRI/Mojolicious-9.39/source/lib/Mojo/Util.pm#L181 metacpan.org · related
- https://metacpan.org/release/SRI/Mojolicious-9.38/source/lib/Mojolicious/Command/Author/generate/app.pm#L202 metacpan.org · related
- https://github.com/mojolicious/mojo/pull/2200 github.com · issue tracking
- https://metacpan.org/release/SRI/Mojolicious-7.28/source/lib/Mojolicious/Command/generate/app.pm#L220 metacpan.org · related
- https://security.metacpan.org/docs/guides/random-data-for-security.html security.metacpan.org · technical description
- https://lists.debian.org/debian-perl/2025/05/msg00016.html lists.debian.org · mailing list
- https://lists.debian.org/debian-perl/2025/05/msg00017.html lists.debian.org · mailing list
- https://lists.debian.org/debian-perl/2025/05/msg00018.html lists.debian.org · mailing list
Source: the record CVE-2024-58135 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse