Security Advisories (1)
CVE-2026-13577 (2026-07-20)

Dancer2 versions through 2.1.0 for Perl generate insecure session ids when CSPRNG modules are unavailable. Dancer2::Core::Role::SessionFactory::generate_id silently falls back to a built-in rand-derived session id when both Math::Random::ISAAC::XS and Crypt::URandom are unavailable. The fallback session id is generated from a SHA-1 hash of a call to the built-in rand function, the absolute path of the Dancer2::Core::Role::SessionFactory module, an internal counter, the process id, the module instance memory address, and a shuffled string of characters (using the List::Util::shuffle function, which also uses the built-in rand function). These are all low-entropy and easily guessed sources. The built-in rand() function is seeded with 32-bits and considered unsuitable for security applications. Predictable session ids could allow an attacker to gain access to systems.

NAME

Dancer2::Logger::File - file-based logging engine for Dancer2

VERSION

version 0.208001

DESCRIPTION

This is a logging engine that allows you to save your logs to files on disk.

Logs are not automatically rotated. Use a log rotation tool like logrotate in copytruncate mode.

METHODS

log($level, $message)

Writes the log message to the file.

CONFIGURATION

The setting logger should be set to File in order to use this logging engine in a Dancer2 application.

The follow attributes are supported:

  • log_dir

    Directory path to hold log files.

    Defaults to logs in the application directory

  • file_name

    The name of the log file.

    Defaults to the environment name with a .log suffix

Here is an example configuration that use this logger and stores logs in /var/log/myapp:

logger: "File"

engines:
  logger:
    File:
      log_dir: "/var/log/myapp"
      file_name: "myapp.log"

AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.