Skip to main content
Vulnerability Database/CVE-2026-104380

CVE-2026-104380: Punk for Perl CSRF Vulnerability

CVE-2026-104380 is a cross-site request forgery flaw in Punk versions 0.48 to 0.54 for Perl that routes Extended CONNECT requests without Origin checks. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-104380 Overview

CVE-2026-104380 affects the Punk web framework for Perl, versions 0.48 through 0.54. The vulnerability allows cross-origin pages to probe arbitrary paths on a Punk server by abusing HTTP/2 and HTTP/3 Extended CONNECT requests used for WebSocket handshakes. These requests are routed as GET matches, bypassing the Origin check that only runs on explicit websocket routes. An attacker's page can open a WebSocket to any path and infer from the handshake response whether that path returns a 2xx status.

Critical Impact

Attackers can perform cross-origin reconnaissance against authenticated endpoints, learning which internal routes exist and respond successfully for a victim's session.

Affected Products

  • Punk for Perl version 0.48
  • Punk for Perl versions 0.49 through 0.54
  • Fixed in Punk for Perl version 0.55

Discovery Timeline

  • 2026-10-06 - CVE-2026-104380 published to the National Vulnerability Database
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-104380

Vulnerability Analysis

The flaw sits inside the ps_serve_one request dispatcher. Punk treats Extended CONNECT requests, defined by RFC 8441 for HTTP/2 and RFC 9220 for HTTP/3, as GET requests during route matching. This behavior lets a WebSocket handshake traverse every GET route, API operation, and mount point registered in the application. The Origin header check that would normally protect WebSocket upgrades is scoped to websocket route matches, so it never executes on these paths. The handler's HTTP status becomes the handshake response, and any 2xx result accepts the WebSocket upgrade. This mislabeled dispatch is categorized under CWE-1385: Missing Origin Validation in WebSockets.

Root Cause

The root cause is a transport-dependent routing mismatch. The dispatcher normalizes Extended CONNECT to GET for routing convenience but forgets that the Origin check lives on the websocket-route branch. GET routes never invoke origin validation, so cross-origin WebSocket handshakes reach them unchecked.

Attack Vector

An attacker hosts a malicious page that a victim visits while authenticated to a Punk-backed application. The page issues new WebSocket("wss://target/some/path") to any path on the Punk server. The browser attaches the victim's cookies to the HTTP/2 or HTTP/3 Extended CONNECT handshake. The attacker's JavaScript listens for open or error events to determine whether the response was 2xx. By scanning paths, the attacker enumerates authenticated endpoints and infers application state across origins. See the MetaCPAN release changes and the version diff between 0.54 and 0.55 for the exact fix.

Detection Methods for CVE-2026-104380

Indicators of Compromise

  • HTTP/2 or HTTP/3 access logs showing Extended CONNECT requests with the :protocol pseudo-header set to websocket targeting non-websocket paths.
  • Spikes in WebSocket handshake attempts from a single referring origin across many unrelated application paths.
  • Short-lived WebSocket connections that close immediately after the handshake response is observed.

Detection Strategies

  • Parse reverse proxy or application logs for CONNECT method requests paired with the websocket protocol identifier against GET-only routes.
  • Correlate Origin header values against the application's allowlist and alert when WebSocket handshakes complete with a disallowed or missing Origin.
  • Baseline typical WebSocket endpoints per application and flag handshakes to paths outside that baseline.

Monitoring Recommendations

  • Enable HTTP/2 and HTTP/3 frame-level logging on edge proxies to capture Extended CONNECT metadata.
  • Forward Punk application logs to a centralized analytics pipeline for cross-origin request correlation.
  • Alert on repeated 2xx WebSocket handshake responses to API paths that are not intended WebSocket endpoints.

How to Mitigate CVE-2026-104380

Immediate Actions Required

  • Upgrade Punk to version 0.55 or later from CPAN as the primary remediation.
  • Audit application routes to identify any GET handler that returns sensitive state based on session cookies.
  • Review reverse proxy configurations to ensure Extended CONNECT requests are only forwarded to intended WebSocket endpoints.

Patch Information

The maintainer released Punk 0.55 on CPAN with the dispatcher fix. The MetaCPAN diff shows the Origin check moved so it runs on Extended CONNECT handshakes regardless of which route matches. Additional discussion is available on the OpenWall oss-security list.

Workarounds

  • Disable HTTP/2 and HTTP/3 at the edge proxy and force clients to HTTP/1.1, which does not support Extended CONNECT upgrades.
  • Enforce an Origin allowlist at the reverse proxy for all CONNECT requests carrying the :protocol websocket pseudo-header.
  • Require authenticated WebSocket subprotocol negotiation or a CSRF token in the handshake path to break silent cross-origin probes.
bash
# Upgrade Punk via cpanm
cpanm LNATION/Punk-0.55.tar.gz

# Verify installed version
perl -MPunk -e 'print $Punk::VERSION, "\n"'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.