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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| SRI | Mojolicious | 7.28 – ≤ 9.45 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libmojolicious-perl | No fix yet | — |
| Debian 13 | libmojolicious-perl | No fix yet | — |
| Debian 12 | libmojolicious-perl | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | libmojolicious-perl | No fix yet | — |
| Ubuntu 26.04 LTS | libmojolicious-perl | No fix yet | — |
| Ubuntu 25.10 | libmojolicious-perl | No fix yet | — |
| Ubuntu 24.04 LTS | libmojolicious-perl | No fix yet | — |
| Ubuntu 22.04 LTS | libmojolicious-perl | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | libmojolicious-perl | No fix yet | — |
| Ubuntu 18.04 LTS | libmojolicious-perl | No fix yet | — |
| Ubuntu 16.04 LTS | libmojolicious-perl | No fix yet | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | perl-Test-Mojo +1 | 9.40-3.amzn2023.0.1 | ALAS2023-2025-985 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | perl-Mojolicious | No fix yet | — |
| Azure Linux 2 (CBL-Mariner) | perl-Mojolicious | No fix yet | — |
Advisories 1
- ALAS2023-2025-985 Important: perl-Mojolicious security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Jun 2, 2025
References
- https://perldoc.perl.org/functions/rand related
- https://metacpan.org/release/SRI/Mojolicious-9.39/source/lib/Mojo/Util.pm#L181 related
- https://metacpan.org/release/SRI/Mojolicious-9.38/source/lib/Mojolicious/Command/Author/generate/app.pm#L202 related
- https://github.com/mojolicious/mojo/pull/2200 issue-tracking
- https://metacpan.org/release/SRI/Mojolicious-7.28/source/lib/Mojolicious/Command/generate/app.pm#L220 related
- https://security.metacpan.org/docs/guides/random-data-for-security.html technical-description
- https://github.com/hashcat/hashcat/pull/4090 exploit
- https://lists.debian.org/debian-perl/2025/05/msg00016.html mailing-list
- https://lists.debian.org/debian-perl/2025/05/msg00017.html mailing-list
- https://lists.debian.org/debian-perl/2025/05/msg00018.html mailing-list
- 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