Security Advisories (2)
CVE-2024-58134 (2025-05-03)

Mojolicious versions from 0.999922 for Perl uses a hard coded string, or the application's class name, as a HMAC session secret by default. These predictable default secrets can be exploited to forge session cookies. An attacker who knows or guesses the secret could compute valid HMAC signatures for the session cookie, allowing them to tamper with or hijack another user's session.

CVE-2024-58135 (2025-05-03)

Mojolicious versions from 7.28 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.

NAME

Mojo - Web development toolkit

SYNOPSIS

# HTTP/WebSocket user agent
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
say $ua->get('www.mojolicious.org')->result->headers->server;

# HTML/XML DOM parser with CSS selectors
use Mojo::DOM;
my $dom = Mojo::DOM->new('<div><b>Hello Mojo!</b></div>');
say $dom->at('div > b')->text;

# Perl-ish templates
use Mojo::Template;
my $mt = Mojo::Template->new(vars => 1);
say $mt->render('Hello <%= $what %>!', {what => 'Mojo'});

# HTTP/WebSocket server
use Mojo::Server::Daemon;
my $daemon = Mojo::Server::Daemon->new(listen => ['http://*:8080']);
$daemon->unsubscribe('request')->on(request => sub ($daemon, $tx) {
  $tx->res->code(200);
  $tx->res->body('Hello Mojo!');
  $tx->resume;
});
$daemon->run;

# Event loop
use Mojo::IOLoop;
for my $seconds (1 .. 5) {
  Mojo::IOLoop->timer($seconds => sub { say $seconds });
}
Mojo::IOLoop->start;

DESCRIPTION

A powerful web development toolkit, with all the basic tools and helpers needed to write simple web applications and higher level web frameworks, such as Mojolicious. Some of the most commonly used tools are Mojo::UserAgent, Mojo::DOM, Mojo::JSON, Mojo::Server::Daemon, Mojo::Server::Prefork, Mojo::IOLoop and Mojo::Template.

See Mojolicious::Guides for more!

SEE ALSO

Mojolicious, Mojolicious::Guides, https://mojolicious.org.