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.
Advisories
Source ID Title
EUVD EUVD EUVD-2025-13365 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.
Fixes

Solution

No solution given by the vendor.


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.

History

Mon, 20 Oct 2025 20:15:00 +0000

Type Values Removed Values Added
Description Mojolicious versions from 7.28 through 9.40 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. 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.
Title Mojolicious versions from 7.28 through 9.40 for Perl may generate weak HMAC session secrets Mojolicious versions from 7.28 for Perl will generate weak HMAC session cookie secrets via "mojo generate app" by default
References

Tue, 17 Jun 2025 14:45:00 +0000

Type Values Removed Values Added
First Time appeared Mojolicious
Mojolicious mojolicious
CPEs cpe:2.3:a:mojolicious:mojolicious:*:*:*:*:*:perl:*:*
Vendors & Products Mojolicious
Mojolicious mojolicious

Mon, 12 May 2025 18:30:00 +0000

Type Values Removed Values Added
Description 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. Mojolicious versions from 7.28 through 9.40 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.
Title Mojolicious versions from 7.28 through 9.39 for Perl may generate weak HMAC session secrets Mojolicious versions from 7.28 through 9.40 for Perl may generate weak HMAC session secrets

Thu, 08 May 2025 08:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 07 May 2025 19:45:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N'}


Sat, 03 May 2025 10:30:00 +0000

Type Values Removed Values Added
Description 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.
Title Mojolicious versions from 7.28 through 9.39 for Perl may generate weak HMAC session secrets
Weaknesses CWE-338
References

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2025-10-20T20:09:18.816Z

Reserved: 2025-04-07T16:06:37.226Z

Link: CVE-2024-58135

cve-icon Vulnrichment

Updated: 2025-05-05T18:16:35.505Z

cve-icon NVD

Status : Modified

Published: 2025-05-03T11:15:48.037

Modified: 2025-10-20T20:15:36.920

Link: CVE-2024-58135

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

No data.