SEVERITY NOT PROVIDED · CVSS 4.0 EPSS 0.6% · 50th percentile CWE-20

CVE-2026-128361: Unsanitized presence key crashes Presence tracker

Published 2026-11-21 · Updated 2026-11-25 · Also known as EEF-CVE-2026-128361, GHSA-pvfx-rx4x-phrr

Summary

An improper input validation vulnerability in Phoenix.Presence allows unauthenticated attackers to cause a denial of service by supplying non-string presence keys. Engineering teams using Phoenix should upgrade to the fixed package versions.

Who is affected

Deployments using Phoenix.Presence where presence keys or fetch callbacks accept client-controlled input are affected. An attacker joining a channel with an unexpected key type can trigger a Protocol.UndefinedError or FunctionClauseError, crashing shard processes, wiping presence states, and potentially exhausting supervisor restart intensity to crash the entire application.

Exploitability

The vulnerability is remotely exploitable over a network with low attack complexity and requires partial privileges or private/public interaction depending on channel setup, carrying a high availability impact. The EPSS score is 0.006 and it is not present in the CISA KEV list.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Hex phoenix >= 1.2.0, < 1.5.16 1.5.16 mix deps.update phoenix
Hex phoenix >= 1.6.0-rc.0, < 1.6.18 1.6.18 mix deps.update phoenix
Hex phoenix >= 1.7.0-rc.0, < 1.7.25 1.7.25 mix deps.update phoenix
Hex phoenix >= 1.8.0-rc.0, < 1.8.17 1.8.17 mix deps.update phoenix

CVSS 4.0 vector

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Attack vectorNetwork
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)None
Integrity (vulnerable system)None
Availability (vulnerable system)High
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

What causes the crash in Phoenix.Presence?

The track/3,4 function accepts any term as a presence key, which later causes a Protocol.UndefinedError or FunctionClauseError when converted or processed if it is a non-string object like a map.

Are all Phoenix applications affected by CVE-2026-128361?

No. Applications are only affected if they use Phoenix.Presence, track presences under keys influenced by client input, or define a fetch/2 callback that can raise an error on unexpected tracked keys.

What are the fixed versions for Phoenix?

The fixed versions are 1.5.16, 1.6.18, 1.7.25, and 1.8.17.

Original advisory description
## Summary Improper Input Validation vulnerability in phoenixframework phoenix (`Phoenix.Presence`) allows an attacker who can join a channel to cause a denial of service via a non-string presence key. `track/3,4` accepts any term as the presence key, such as a JSON object taken from a join payload. The key is converted with `to_string/1` only later, in `Phoenix.Presence.group/1`, which raises `Protocol.UndefinedError` on a map. `group/1` runs whenever presences are listed and when each presence diff is broadcast, together with the application's `fetch/2`, which can likewise raise on an unexpected key. Once such a key is tracked, every process that lists presences on the topic crashes, typically each channel that joins it, and presence diffs for the topic are lost. From 1.7.0 the diff runs in a `Task.Supervisor.async` task linked to the tracker shard, and `Phoenix.Presence.handle_info/2` has no clause for its failure. The shard then terminates, taking down every channel and LiveView process tracked on it and erasing presence state for all its topics. Repeated joins exhaust the restart intensity and take down the application supervisor. This issue affects phoenix: from 1.2.0 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. ## Details **1. Key accepted.** The `track/3,4` injected by `use Phoenix.Presence` passes any term to `Phoenix.Tracker.track`, which returns `{:ok, ref}`. The documented pattern `Presence.track(socket, name, meta)` with `name` from the join payload lets a client choose a map as the key. **2. Deferred conversion.** `Phoenix.Presence.group/1` converts each key with `to_string/1`. It runs in `Phoenix.Presence.list/2`, in the calling process, and in `handle_diff/2` before the application's `fetch/2`. A map key raises `Protocol.UndefinedError` there, as does a `fetch/2` such as the moduledoc's `String.to_integer(key)` on a non-numeric key. **3. Topic crash.** While the key stays tracked, every `list` on the topic raises. The documented `after_join` that pushes `Presence.list(socket)` therefore crashes each later joiner's channel. Before 1.7.0, `handle_diff/2` runs in an unlinked `Task.Supervisor.start_child` task, so a failing diff only loses that batch of joins and leaves. **4. Shard crash (1.7.0 and later).** `handle_diff/2` runs the diff in a `Task.Supervisor.async` task linked to the tracker shard, and `Phoenix.Presence.handle_info/2` matches only the task's success reply. The failure terminates the shard (`FunctionClauseError`), every tracked process linked to it dies, and presence state is wiped. Repeated joins exhaust the supervisor's restart intensity. ## Proof of concept 1. Run a Phoenix endpoint with a channel whose join reads `name` from the join payload and then calls `MyPresence.track(socket, name, %{online_at: 1})`. 2. Join the topic with 15 clients using string names, and confirm `MyPresence.list(topic)` returns 15 entries. 3. Join once more with the payload `{"name": {"x": 1}}`. 4. The log shows `Protocol.UndefinedError` from `Phoenix.Presence.group/1`, then the shard terminating. All 15 clients receive `phx_error`, and `MyPresence.list(topic)` returns 0 entries. ## Impact With one channel join an attacker makes the topic's presence unusable: every later join that lists presences crashes, and presence updates stop. From 1.7.0 the same join terminates every channel and LiveView process tracked on the Presence shard and erases presence state for all its topics, and repeating it brings down the application. ## Workarounds Validate every presence key before passing it to `track/3,4`, `untrack/2,3` or `update/3,4`, so that only strings reach the tracker. For a key taken from client input, reject a join whose value is not a binary, or convert it explicitly: ```elixir def join("room:" <> _, %{"name" => name}, socket) when is_binary(name) do send(self(), {:after_join, name}) {:ok, socket} end ``` A `fetch/2` callback must also not raise on any tracked key. ## Configurations The application must use `Phoenix.Presence` and either track presences under a key influenced by client input (such as a name taken from the channel join payload), or define a `fetch/2` callback that can raise on a tracked key. Applications that track only server-controlled string keys and whose `fetch/2` cannot raise are not affected.

References

Source records: EEF-CVE-2026-128361 (OSV.dev) · EPSS by FIRST, 2026-11-25.