CVE-2024-58135
published medium CVSS 3.1 · 5.3Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SRI | — | Mojolicious7.28 through 9.45 · Other versions: unaffected | Affected | Not stated | CPANSec |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2025-985 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | perl-Mojoliciousnoarch | Listed in advisory | Not stated | ALAS2023-2025-985 |
| Amazon Linux | AL2023 | perl-Mojolicioussrc | Listed in advisory | Not stated | ALAS2023-2025-985 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.3 / 10
- Severity
- medium
- Provider
- CISA-ADP · adp
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| SRI | Mojolicious | 7.28 through 9.45 (affected · custom)Default: unaffected | CPANSec · cna |
Weaknesses
2- CWE-338 CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
- CWE-338 CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
References
13- https://github.com/hashcat/hashcat/pull/4090
- https://github.com/mojolicious/mojo/commit/789cfa43f9118852b38cbd1fd0a2596bcb9821ea.patch
- https://github.com/mojolicious/mojo/commit/fb3733f92cc8a3344e6d615b3c7dac9d538eeab0.patch
- https://github.com/mojolicious/mojo/pull/2200
- https://lists.debian.org/debian-perl/2025/05/msg00016.html
- https://lists.debian.org/debian-perl/2025/05/msg00017.html
- https://lists.debian.org/debian-perl/2025/05/msg00018.html
- https://metacpan.org/release/SRI/Mojolicious-7.28/source/lib/Mojolicious/Command/generate/app.pm#L220
- https://metacpan.org/release/SRI/Mojolicious-9.38/source/lib/Mojolicious/Command/Author/generate/app.pm#L202
- https://metacpan.org/release/SRI/Mojolicious-9.39/source/lib/Mojo/Util.pm#L181
- https://metacpan.org/release/SRI/Mojolicious-9.46/source/Changes
- https://perldoc.perl.org/functions/rand
- https://security.metacpan.org/docs/guides/random-data-for-security.html
Provider assertions
2CPANSec · cna
Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 7638813f808f1324961305efc3b01aec35dfed08c7fde0c077af50c81a61cf15
- Ingested
- 23 Sep 2026, 08:32:30 UTC
- Source record
- Official CVE record