Security Advisories (1)
CVE-2024-58041 (2026-02-24)

Smolder versions through 1.51 for Perl uses insecure rand() function for cryptographic functions. Smolder 1.51 and earlier for Perl uses the rand() function as the default source of entropy, which is not cryptographically secure, for cryptographic functions. Specifically Smolder::DB::Developer uses the Data::Random library which specifically states that it is "Useful mostly for test programs". Data::Random uses the rand() function.

NAME

Smolder::Mech

DESCRIPTION

Test::WWW::Mechanize subclass with some Smolder specific helper methods

my $mech = Smolder::Mech->new();
$mech->login($user);

METHODS

login

This routine will go to the login form, provide credentials and login. It receives the following named args, all required:

username

The text to use for the username field

password

The text to use for the password field. If none is given, it will use 'testing'.

$mech->login(
    username    => $username,
    password    => 's3cr3t',
);

logout

Logout the current user.

$mech->logout();

get

Extends get() from Test::WWW::Mechanize to also disconnect any open Database handles before making a request if we are using SQLite to avoid locking the database

submit

Extends submit() from Test::WWW::Mechanize to also disconnect any open Database handles before making a request if we are using SQLite to avoid locking the database

request

Extends request() from Test::WWW::Mechanize to also disconnect any open Database handles before making a request if we are using SQLite to avoid locking the database

contains_message

This method will look in the X-JSON HTTP header of the response, look through each message in the messages array and see if any of them match the given message.

If given message is a scalar, the message must match exactly, else if it's a regex, then it will be matched against that.