Description
Dancer2 versions from 2.0.0 before 2.2.0 for Perl dispatch a route that a dying hook refused when the exception handler halts the response in compile_hooks.

A hook that dies fires core.app.hook_exception, then calls cleanup unless the failing hook is the exception handler. A handler that halts does not stop that cleanup, which discards the request, response and session the dispatcher has yet to read, so the refused route runs.

The handler has to halt the response object by calling its halt method or setting is_halted: the halt keyword unwinds through with_return before cleanup runs.

A check in a before hook is not enforced: the caller gets the refusal, while the route body runs and its writes land.
Published: 2026-09-22
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Unexpected route execution after request handling
Action: Patch Now
AI Analysis

Impact

In Dancer2 versions 2.0.0 through 2.1.x, a dying hook that throws an exception triggers the core.app.hook_exception handler, which begins a cleanup routine that discards the request, response and session objects even when the exception handler itself halts the response; as a result, the dispatcher still runs the route body through its refusal machinery, allowing the route code to execute on a request that should have been aborted, potentially leading to unintended code execution within routes and incorrect responses.

Affected Systems

All installations of the Dancer2 Perl web framework from version 2.0.0 up to (but not including) 2.2.0 are affected; release 2.2.0 and later address the issue and are not impacted.

Risk and Exploitability

The CVSS score of 7.5 classifies the vulnerability as high severity; the EPSS score of < 1% indicates a very low probability of automated exploitation, and it is not listed in the CISA KEV catalog; the likely attack vector, inferred from the fact that the flaw activates when a dying hook halts the response, is triggering a hook failure through crafted input or a compromised plugin, which could cause the route to run unexpectedly.

Generated by OpenCVE AI on September 23, 2026 at 00:07 UTC.

Remediation

Vendor Solution

Upgrade to Dancer2 2.2.0 or later.


OpenCVE Recommended Actions

  • Upgrade Dancer2 to version 2.2.0 or later to apply the official fix for the hook exception handling bug.
  • Ensure that any exception‑handling hook does not call the halt keyword; instead let the exception propagate naturally.
  • Audit all custom hooks for die statements or other actions that could trigger cleanup and verify that routes do not run after an exception.
  • Enable detailed logging for hook exceptions so that unintended route executions can be detected during normal operation.

Generated by OpenCVE AI on September 23, 2026 at 00:07 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 28 Sep 2026 20:15:00 +0000

Type Values Removed Values Added
First Time appeared Perldancer
Perldancer dancer2
Vendors & Products Perldancer
Perldancer dancer2

Tue, 22 Sep 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 22 Sep 2026 03:30:00 +0000

Type Values Removed Values Added
References

Tue, 22 Sep 2026 01:00:00 +0000

Type Values Removed Values Added
Description Dancer2 versions from 2.0.0 before 2.2.0 for Perl dispatch a route that a dying hook refused when the exception handler halts the response in compile_hooks. A hook that dies fires core.app.hook_exception, then calls cleanup unless the failing hook is the exception handler. A handler that halts does not stop that cleanup, which discards the request, response and session the dispatcher has yet to read, so the refused route runs. The handler has to halt the response object by calling its halt method or setting is_halted: the halt keyword unwinds through with_return before cleanup runs. A check in a before hook is not enforced: the caller gets the refusal, while the route body runs and its writes land.
Title Dancer2 versions from 2.0.0 before 2.2.0 for Perl dispatch a route that a dying hook refused when the exception handler halts the response in compile_hooks
Weaknesses CWE-460
References

Subscriptions

Perldancer Dancer2
cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-09-22T19:25:34.768Z

Reserved: 2026-09-18T15:06:15.116Z

Link: CVE-2026-93710

cve-icon Vulnrichment

Updated: 2026-09-22T02:09:45.582Z

cve-icon NVD

Status : Deferred

Published: 2026-09-22T01:16:55.730

Modified: 2026-09-22T20:17:12.270

Link: CVE-2026-93710

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-28T19:48:04Z

Weaknesses
  • CWE-460

    Improper Cleanup on Thrown Exception