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
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.3
Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default
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.
- Record
CVE-2024-58135- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-338, CWE-338
- Updated
- 2026-11-02
EUVDEUVD-2025-13365
5.3
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.
- Record
EUVD-2025-13365- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-3r5v-gmfp-3mh9
5.3
Mojolicious versions from 7.28 through 9.39 for Perl may generate weak HMAC session secrets. ...
Mojolicious versions from 7.28 through 9.39 for Perl may generate weak HMAC session secrets.
When creating a default app 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.
- Record
GHSA-3r5v-gmfp-3mh9- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-338
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2024-58135- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-338
- Updated
- 2026-11-02
OSV
5.3
Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default
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.
- Record
CVE-2024-58135- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-338
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-58135
5.3
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.
- Record
DEBIAN-CVE-2024-58135- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-58135
5.3
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.
- Record
UBUNTU-CVE-2024-58135- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Updated
- 2026-11-02
OSVAZL-61741 No score
CVE-2024-58135 affecting package perl-Mojolicious 8.57-3
Mojolicious versions from 7.28 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.
- Record
AZL-61741- Updated
- 2026-11-02
OSVAZL-61822 No score
CVE-2024-58135 affecting package perl-Mojolicious 8.57-3
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.
- Record
AZL-61822- Updated
- 2026-11-05
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
perl-MojoliciousAzure Linux:2 |
through 8.57-3 | None known |
perl-MojoliciousAzure Linux:3 |
through 8.57-3 | None known |
libmojolicious-perlDebian:12 |
All versions, plus listed versions 9.31+dfsg-19.33+dfsg-19.34+dfsg-19.35+dfsg-19.36+dfsg-1 Show 15 moreShow less9.36+dfsg-1~bpo12+29.37+dfsg-19.37+dfsg-29.37+dfsg-2~bpo12+19.38+dfsg-19.39+dfsg-19.42+dfsg-19.42+dfsg-1~bpo13+29.45+dfsg-19.45+dfsg-29.46+dfsg-19.47+dfsg-19.48+dfsg-19.49+dfsg-19.53+dfsg-1 |
None known |
libmojolicious-perlDebian:13 |
All versions, plus listed versions 9.39+dfsg-19.42+dfsg-19.42+dfsg-1~bpo13+29.45+dfsg-19.45+dfsg-2 Show 5 moreShow less9.46+dfsg-19.47+dfsg-19.48+dfsg-19.49+dfsg-19.53+dfsg-1 |
None known |
libmojolicious-perlDebian:14 |
All versions, plus listed versions 9.39+dfsg-19.42+dfsg-19.42+dfsg-1~bpo13+29.45+dfsg-19.45+dfsg-2 Show 5 moreShow less9.46+dfsg-19.47+dfsg-19.48+dfsg-19.49+dfsg-19.53+dfsg-1 |
None known |
libmojolicious-perlUbuntu:16.04:LTS |
All versions, plus listed versions 6.15+dfsg-16.15+dfsg-1ubuntu1 |
None known |
libmojolicious-perlUbuntu:18.04:LTS |
All versions, plus listed versions 7.39+dfsg-1ubuntu17.43+dfsg-1ubuntu17.57+dfsg-1ubuntu17.59+dfsg-1ubuntu1 |
None known |
libmojolicious-perlUbuntu:20.04:LTS |
All versions, plus listed versions 8.22+dfsg-18.23+dfsg-18.26+dfsg-18.27+dfsg-18.32+dfsg-18.33+dfsg-1 |
None known |
libmojolicious-perlUbuntu:22.04:LTS |
All versions, plus listed versions 8.71+dfsg-19.22+dfsg-1 |
None known |
libmojolicious-perlUbuntu:24.04:LTS |
All versions, plus listed versions 9.33+dfsg-19.35+dfsg-1 |
None known |
libmojolicious-perlUbuntu:25.10 |
All versions, plus listed versions 9.39+dfsg-1 |
None known |
libmojolicious-perlUbuntu:26.10 |
All versions, plus listed versions 9.42+dfsg-19.45+dfsg-29.46+dfsg-19.48+dfsg-1 |
None known |
libmojolicious-perlUbuntu:26.04:LTS |
All versions, plus listed versions 9.39+dfsg-19.42+dfsg-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-58135 is a medium vulnerability (CVSS 5.3) in Mojolicious, published May 3, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.58%, the 47th percentile. No source names a fixed version.
References
perldoc.perl.org/functions/rand
metacpan.org/release/SRI/Mojolicious-9.39/source/lib/Mojo/Util.pm
metacpan.org/release/SRI/Mojolicious-9.38/source/lib/Mojolicious/Command/Author/generate/app.pm
github.com/mojolicious/mojo/pull/2200
metacpan.org/release/SRI/Mojolicious-7.28/source/lib/Mojolicious/Command/generate/app.pm
security.metacpan.org/docs/guides/random-data-for-security.html
Show 16 moreShow less
github.com/hashcat/hashcat/pull/4090
lists.debian.org/debian-perl/2025/05/msg00016.html
lists.debian.org/debian-perl/2025/05/msg00017.html
lists.debian.org/debian-perl/2025/05/msg00018.html
metacpan.org/release/SRI/Mojolicious-9.46/source/Changes
github.com/mojolicious/mojo/commit/fb3733f92cc8a3344e6d615b3c7dac9d538eeab0.patch
github.com/mojolicious/mojo/commit/789cfa43f9118852b38cbd1fd0a2596bcb9821ea.patch
nvd.nist.gov/vuln/detail/CVE-2024-58135
github.com/advisories/GHSA-3r5v-gmfp-3mh9
cpan.org/modules
github.com/CVEProject/cvelistV5/tree/main/cves/2024/58xxx/CVE-2024-58135.json
github.com/mojolicious/mojo
security-tracker.debian.org/tracker/CVE-2024-58135
ubuntu.com/security/CVE-2024-58135
cve.org/CVERecord?id=CVE-2024-58135
lists.security.metacpan.org/cve-announce/msg/29241187