# CVE-2026-13577: Dancer2 versions before 2.2.0 for Perl generate insecure session ids when required CSPRNG modules are unavailable

> Dancer2 generates predictable session IDs using low-entropy sources when secure random modules are missing, allowing attackers to hijack user sessions.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Jul 2026
- **Updated:** 20 Sep 2026
- **Also known as:** DEBIAN-CVE-2026-13577, GHSA-ccc2-34g9-j7rg, MGASA-2026-0437, UBUNTU-CVE-2026-13577

## What is CVE-2026-13577?

CVE-2026-13577 is a high-severity vulnerability, published on 20 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Dancer2 versions before 2.2.0 for Perl generate insecure session ids when required CSPRNG modules are unavailable.

Dancer2::Core::Role::SessionFactory::generate_id silently falls back to a built-in rand-derived session id unless both Math::Random::ISAAC::XS and Crypt::URandom are available.

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.

Weakness: CWE-340 (Generation of Predictable Numbers or Identifiers), CWE-338 (Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG))

## Which versions are affected by CVE-2026-13577?


## How do I fix CVE-2026-13577?

Upgrade to a fixed version.

## Is CVE-2026-13577 being exploited?

There is no known exploitation of CVE-2026-13577 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-13577 and fix it if it is affected.

What it is: CVE-2026-13577 is a high-severity vulnerability, published on 20 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-13577 in the wild and no public exploit code.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-13577/ (Markdown: https://insights.sbomify.com/CVE-2026-13577/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-13577
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-13577
- OSV: https://osv.dev/vulnerability/CVE-2026-13577

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-13577/
Summaries are generated and may contain mistakes; the official description above is the record.
