CVE-2026-13577 in Dancer2info

Summary

by MITRE • 07/20/2026

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.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 07/20/2026

This vulnerability exists in Dancer2 versions through 2.1.0 where the session identifier generation mechanism fails to maintain cryptographic security when required cryptographically secure random number generators are unavailable. The core issue manifests in the Dancer2::Core::Role::SessionFactory::generate_id method which implements a silent fallback strategy that compromises security by relying on predictable sources of randomness. When both Math::Random::ISAAC::XS and Crypt::URandom modules are absent from the system, the framework automatically reverts to an insecure implementation that generates session identifiers using low-entropy data sources.

The technical flaw stems from the reliance on multiple weak entropy sources that together create a highly predictable session identifier generation process. The system constructs session IDs by hashing a combination of elements including output from Perl's built-in rand function seeded with only 32 bits of entropy, the absolute file path of the session factory module, an internal counter, the process identifier, the memory address of the module instance, and a shuffled character string produced by List::Util::shuffle. Each of these components contributes minimal entropy to the final hash output, creating a scenario where attackers can effectively predict session identifiers through statistical analysis or brute force methods.

The operational impact of this vulnerability is severe as it directly enables session hijacking attacks that could allow unauthorized access to protected systems and data. When an attacker successfully predicts a valid session identifier, they can impersonate legitimate users and gain access to restricted resources, potentially leading to complete system compromise. This vulnerability affects any Dancer2 application running on systems where the required CSPRNG modules are unavailable, which may occur in minimal deployments, containerized environments, or systems with restricted module installations.

The security implications align with CWE-330 use of insufficent entropy and CWE-310 cryptographic weakness, both of which relate to improper handling of random number generation for security purposes. From an ATT&CK perspective, this vulnerability maps to T1566 credential access through session hijacking techniques that exploit predictable authentication tokens. The fallback mechanism violates fundamental security principles by automatically degrading to insecure operations without explicit user notification or intervention.

Mitigation strategies include ensuring that required CSPRNG modules such as Math::Random::ISAAC::XS and Crypt::URandom are installed and available in all deployment environments, upgrading to Dancer2 versions that address this vulnerability, implementing additional session security measures such as IP binding or user agent verification, and monitoring for unauthorized access attempts. Organizations should also consider implementing more robust entropy sources at the system level and regularly audit their application dependencies to ensure proper cryptographic support is maintained throughout their infrastructure.

Responsible

CPANSec

Reservation

06/28/2026

Disclosure

07/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00145

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!