CVE-2026-129344 — Phoenixframework Phoenix — CWE-248
CVE-2026-129344 is a HIGH severity Denial-of-Service (DoS) vulnerability (CWE-248) (CVSS 8.2/10 (EPSS: 0.7%)) affecting Phoenixframework Phoenix. Technical vector analysis shows that an attacker can exploit this flaw remotely over the network without authentication (PR:N) with zero user interaction (UI:N), causing high-impact service disruption (A:H).
📄 Official NVD / MITRE Original Record Text
Uncaught Exception vulnerability in phoenixframework phoenix allows an unauthenticated attacker to cause a denial of service via a client-selected legacy serializer on binary channel broadcasts. When an application broadcasts {:binary, data} payloads on a channel topic, any client that connects without a vsn parameter, or with vsn=1.0.0, and joins that topic makes those broadcasts fail. Phoenix.Channel.Server.send/4 encodes each broadcast with every subscriber's own serializer inside the PubSub dispatch loop, calling fastlane!/1 with no rescue, and the negotiated Phoenix.Socket.V1.JSONSerializer raises Protocol.UndefinedError on a binary payload. Every binary broadcast on the topic then crashes the broadcasting process and skips every subscriber dispatched after the attacker. For broadcasts arriving from other nodes the loop runs in the PubSub adapter worker, whose repeated crashes restart the PubSub supervisor and empty the node's subscription registry while sockets stay connected. This issue affects phoenix: from 1.5.7 before 1.5.16, from 1.6.0-rc.0 before 1.6.18, from 1.7.0-rc.0 before 1.7.25, and from 1.8.0-rc.0 before 1.8.17.
CVE‑2026‑129344 – Phoenix Framework “Uncaught Exception” DoS via Legacy Serializer
🎯 What is this vulnerability?
| Attribute | Detail |
|---|---|
| CVE | CVE‑2026‑129344 |
| CWE | CWE‑248 “Improper Handling of Exceptions” |
| CVSS v4.0 Vector | AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (Network‑only, Low attack complexity, Privileges required = None, No user interaction, High impact on Availability) |
| Affected component | Phoenix.Channel.Server.send/4 – the function that serialises a broadcast for every subscriber inside the PubSub dispatch loop. |
| Root cause | The dispatch loop calls fastlane!/1 without a try … rescue block. When a subscriber’s negotiated serializer is the legacy Phoenix.Socket.V1.JSONSerializer, that serializer raises a Protocol.UndefinedError when asked to encode a binary payload ({:binary, data}). Because the exception is not rescued, it bubbles up and crashes the broadcasting process (or the PubSub adapter worker on remote nodes). The crash aborts the current broadcast and, on repeated use, forces the PubSub supervisor to restart, wiping the node’s subscription registry while the underlying sockets stay alive.
In short: an unauthenticated client can force the server to use a serializer that cannot handle the broadcast format, causing an uncaught exception that terminates the process responsible for delivering the broadcast. The flaw is purely a logic/exception‑handling omission – no input validation or version negotiation check is performed before invoking the serializer.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All code snippets are illustrative – the exact channel name, topic, and endpoint depend on the target application.
1️⃣ Discovery & Reconnaissance
| Step | Action | How the attacker does it | |
|---|---|---|---|
| a. Identify Phoenix usage | Look for typical Phoenix fingerprints (e.g., phoenix.js in the HTML, socket.io‑style WebSocket handshake, phx- prefixed HTML attributes). | curl -s https://target.example.com | grep -i phoenix or passive traffic analysis (Wireshark) of a WebSocket handshake (upgrade: websocket). |
| b. Determine Phoenix version | Phoenix embeds its version in the JavaScript client (phoenix.js contains var VERSION = "1.5.16"). | curl https://target.example.com/phoenix.js | grep VERSION.<br>Alternatively, enumerate the phx-socket endpoint (/socket/websocket) and inspect the vsn query parameter returned in the connect reply. |
| c. Verify vulnerable range | The CVE affects 1.5.7‑1.5.15, 1.6.0‑rc.0‑1.6.17, 1.7.0‑rc.0‑1.7.24, 1.8.0‑rc.0‑1.8.16. | If the discovered version falls inside any of those ranges, the target is vulnerable. |
2️⃣ Exploitation
Goal: Join a channel without a vsn parameter (or with vsn=1.0.0) so the server negotiates the legacy Phoenix.Socket.V1.JSONSerializer. Then broadcast a binary payload that triggers the exception.
2.1 Establish a WebSocket connection (illustrative)
# 1. Open a raw WebSocket connection (no vsn query param)
# Using websocat (or wscat) for simplicity.
websocat "ws://target.example.com/socket/websocket?token=ATTACKER"If the application requires a token, a dummy or empty token is often accepted for public channels.
2.2 Join a vulnerable topic
# Phoenix expects a JSON message of the form:
# {"topic":"room:lobby","event":"phx_join","payload":{},"ref":"1"}
{
"topic":"room:lobby",
"event":"phx_join",
"payload":{},
"ref":"1"
}Because the connection was made without vsn, the server falls back to the V1 serializer.
2.3 Trigger the broadcast
The attacker does not need to be the broadcaster; any legitimate client that later broadcasts a binary payload on the same topic will cause the crash. However, the attacker can also act as the broadcaster if the channel permits it (e.g., a public chat channel that accepts {:binary, data} messages).
# Example Elixir code that a legitimate client could run (or that the attacker can send if the channel allows):
Phoenix.Channel.broadcast_from!(self(), "room:lobby", "new_msg", {:binary, <<0xDE,0xAD,0xBE,0xEF>>})From the attacker’s side (raw WebSocket payload):
{
"topic":"room:lobby",
"event":"new_msg",
"payload":{"binary":"3q2+7w=="}, // Base64 of <<0xDE,0xAD,0xBE,0xEF>>
"ref":"2"
}When the server processes this broadcast:
1. Phoenix.Channel.Server.send/4 iterates over all subscribers of "room:lobby".
2. For each subscriber it calls fastlane!(serializer, payload).
3. The V1 JSON serializer receives a tuple {:binary, data} → raises Protocol.UndefinedError.
4. No rescue → the broadcasting process crashes.
5. The crash aborts the current broadcast and, on repeated broadcasts, forces the PubSub supervisor to restart, wiping the subscription registry.
Result: All subsequent messages on that topic are dropped for the remainder of the node’s uptime (or until the process is manually restarted). The attacker does not need any authentication or special privileges.
3️⃣ Post‑exploitation (Impact Realisation)
| Phase | What the attacker achieves |
|---|---|
| Denial of Service | The broadcasting process (or PubSub adapter worker) crashes repeatedly, causing the PubSub supervisor to restart. Subscriptions are cleared, so legitimate clients no longer receive any broadcast on the affected topic. |
| Service Degradation | Even if the application recreates the subscription registry, the attacker can keep re‑joining with a V1 serializer, causing a continuous crash loop that consumes CPU and memory (process restarts, log spamming). |
| No Privilege Escalation / RCE | The vulnerability is limited to availability; there is no code execution or data leakage beyond what is already exposed by the channel. |
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS vector) |
|---|---|
| Confidentiality | None – VC:N. No data is disclosed. |
| Integrity | None – VI:N. No data is altered. |
| Availability | High – VA:H. The crash of the PubSub process can render real‑time features (chat, notifications, live updates) completely unavailable. In large‑scale deployments that rely heavily on Phoenix Channels (e.g., collaborative editors, live dashboards), this can translate into a full‑service outage. |
| Scope | Unchanged – SC:N. The impact is confined to the Phoenix node/process; it does not directly affect other hosts. |
| Attack Vector | Network‑only – AV:N. The attacker only needs to reach the WebSocket endpoint. |
| Complexity | Low – AC:L. No authentication, no special payload crafting beyond a binary broadcast. |
| Privileges Required | None – PR:N. |
| User Interaction | None – UI:N. |
Practical consequences
- Public‑facing Phoenix applications that expose any channel to unauthenticated users (e.g., public chat, presence, live‑updates) can be taken offline instantly.
- In multi‑node clusters, the crash of a PubSub adapter worker on one node forces a supervisor restart, clearing that node’s subscription cache while the other nodes continue to operate – leading to partial service degradation and confusing “missing messages” for end‑users.
- Because sockets stay connected, the client UI may appear “hung” (no new events) while the underlying TCP connection is still alive, making the problem harder to diagnose.
🛡️ Remediation & Mitigation
1️⃣ Patch / Upgrade
| Affected version range | Fixed in |
|---|---|
1.5.7 – 1.5.15 | 1.5.16 |
1.6.0‑rc.0 – 1.6.17 | 1.6.18 |
1.7.0‑rc.0 – 1.7.24 | 1.7.25 |
1.8.0‑rc.0 – 1.8.16 | 1.8.17 |
Action: Upgrade the Phoenix dependency in mix.exs to at least the versions listed above and redeploy. Example:
defp deps do
[
{:phoenix, "~> 1.8.17"},
# other deps …
]
endRun mix deps.update phoenix && mix compile && mix release (or your usual deployment pipeline).
2️⃣ Workarounds (if immediate upgrade is not possible)
| Workaround | How to implement | Pros / Cons |
|---|---|---|
| Force V2 serializer for all connections | In the socket module, override connect/3 to reject connections that do not supply a vsn ≥ 2.0.0. Example: | Pros: eliminates the vulnerable code path.<br>Cons: may break legacy clients that only support V1. |
| Rescue the exception in the dispatch loop | Patch Phoenix.Channel.Server.send/4 locally (or monkey‑patch) to wrap fastlane!/1 in try … rescue Protocol.UndefinedError -> :ok end. | Pros: minimal code change, works for all versions.<br>Cons: requires custom build; may hide other bugs. |
| Restrict channel joins to authenticated users | Add a join/3 guard that checks socket.assigns[:user_id] and returns {:error, %{reason: "unauthenticated"}} for anonymous sockets. | Pros: reduces attack surface (attacker must first obtain a valid token).<br>Cons: may not be feasible for truly public channels. |
| Disable binary broadcasts on public topics | Audit channel code and ensure {:binary, _} is never used on topics that unauthenticated users can join. Replace with base64‑encoded strings handled by a custom serializer that accepts binary. | Pros: eliminates the trigger payload.<br>Cons: may require application‑level changes. |
3️⃣ Detection – Log & Telemetry Indicators
| Indicator | Where to look | Example pattern |
|---|---|---|
| Crash stack trace | Application logs (log/console.log, error_logger, or the OTP crash reports). | (Protocol.UndefinedError) protocol Phoenix.Socket.V1.JSONSerializer not implemented for {:binary, <<...>>} |
| PubSub supervisor restart | OTP supervisor logs (:supervisor messages). | {:restart, Phoenix.PubSub, :normal, [{Phoenix.PubSub, :start_link, ...}]} |
| Sudden drop in broadcast deliveries | Metrics (Prometheus phoenix_channel_messages_sent_total vs phoenix_channel_messages_failed_total). | Spike in phoenix_channel_messages_failed_total coinciding with the above stack trace. |
| WebSocket connection stays open but no events | Front‑end console (console.log("socket closed") not triggered) + server logs showing “no subscribers for topic …”. | No subscribers for topic "room:lobby" after a crash. |
| Repeated fastlane! errors** | If you enable :logger level :error for Phoenix.Channel.Server. | error: fastlane! raised Protocol.UndefinedError … |
SIEM rule (pseudo‑code):
if log.message contains "Protocol.UndefinedError"
and log.message contains "Phoenix.Socket.V1.JSONSerializer"
and log.source = "phoenix"
then alert "Potential CVE‑2026‑129344 DoS attempt"⚠️ Urgency
Patch priority: Critical for any production Phoenix deployment that exposes a channel to unauthenticated clients (including public chat, presence, or live‑update channels).
If the application only allows authenticated sockets, the risk drops to “High” but a patch is still strongly recommended because many Phoenix apps inadvertently expose a public channel (e.g., a “heartbeat” or “notifications” channel).
TL;DR
Protocol.UndefinedError when a V1 JSON serializer processes a binary broadcast. vsn ≥ 2.0.0, or remove binary payloads from public topics. Protocol.UndefinedError stack traces, PubSub supervisor restarts, and a sudden rise in failed broadcast metrics. [🤖 CVE Professor AI Security Engine]
FOFA Query