CVE-2024-58135Mojolicious versions from 7.28 through 9.45 for Perl will generate weak HMAC session…
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.
What to do
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | libmojolicious-perl | Fix pending | UBUNTU-CVE-2024-58135 | |
| Ubuntu 26.04 | libmojolicious-perl | Under investigation | UBUNTU-CVE-2024-58135 | |
| Ubuntu 25.10 | libmojolicious-perl | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-58135 | |
| Ubuntu 24.04 | libmojolicious-perl | Under investigation | UBUNTU-CVE-2024-58135 | |
| Ubuntu 22.04 | libmojolicious-perl | Under investigation | UBUNTU-CVE-2024-58135 | |
| Ubuntu 20.04 | libmojolicious-perl | Fix pending | UBUNTU-CVE-2024-58135 | |
| Ubuntu 18.04 | libmojolicious-perl | Fix pending | UBUNTU-CVE-2024-58135 | |
| Ubuntu 16.04 | libmojolicious-perl | Fix pending | UBUNTU-CVE-2024-58135 | |
| Debian 14 | libmojolicious-perl | Fix pending | DEBIAN-CVE-2024-58135 | |
| Debian 13 | libmojolicious-perl | Fix pending | DEBIAN-CVE-2024-58135 | |
| Debian 12 | libmojolicious-perl | Fix pending | DEBIAN-CVE-2024-58135 |
What the vendor says
As published in the CVE record by CPANSec, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- SRI Mojolicious: affected: 7.28 to 9.45
Solution: Upgrade to version 9.46 and replace previously generated secrets.
Workaround: Ensure that your secret, stored in the application's configuration file, is at least 128 bit of cryptographically secure random data. For example, to generate a 256 bit secret, one could use the output generated by the "openssl rand -base64 32" command.
Vendor advisories:
- https://metacpan.org/release/SRI/Mojolicious-9.46/source/Changes (release-notes)
- https://github.com/mojolicious/mojo/commit/fb3733f92cc8a3344e6d615b3c7dac9d538eeab0.patch (patch)
- https://github.com/mojolicious/mojo/commit/789cfa43f9118852b38cbd1fd0a2596bcb9821ea.patch (patch)
References
- https://perldoc.perl.org/functions/rand
- https://metacpan.org/release/SRI/Mojolicious-9.39/source/lib/Mojo/Util.pm#L181
- https://metacpan.org/release/SRI/Mojolicious-9.38/source/lib/Mojolicious/Command/Author/generate/app.pm#L202
- https://github.com/mojolicious/mojo/pull/2200
- https://metacpan.org/release/SRI/Mojolicious-7.28/source/lib/Mojolicious/Command/generate/app.pm#L220
- https://security.metacpan.org/docs/guides/random-data-for-security.html
- https://github.com/hashcat/hashcat/pull/4090
- 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-9.46/source/Changes
- https://github.com/mojolicious/mojo/commit/fb3733f92cc8a3344e6d615b3c7dac9d538eeab0.patch
- https://github.com/mojolicious/mojo/commit/789cfa43f9118852b38cbd1fd0a2596bcb9821ea.patch
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.