EEF-CVE-2026-128361

Source
https://cna.erlef.org/osv/EEF-CVE-2026-128361.html
Import Source
https://cna.erlef.org/osv/EEF-CVE-2026-128361.json
JSON Data
https://api.osv.dev/v1/vulns/EEF-CVE-2026-128361
Aliases
  • GHSA-pvfx-rx4x-phrr
  • CVE-2026-128361
Published
2026-11-21T11:09:51Z
Modified
2026-11-21T11:15:02Z
Severity
  • 8.2 (High) CVSS_V4 - 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 (Source: CNA) CVSS Calculator
Summary
Unsanitized presence key crashes Presence tracker
Details

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:

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.

Database specific
{
    "capec_ids": [
        "CAPEC-153"
    ],
    "cpe_ids": [
        "cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*"
    ],
    "cwe_ids": [
        "CWE-20"
    ]
}
References
Credits
    • Peter Ullrich - FINDER
    • Peter Ullrich - REPORTER
    • Steffen Deusch - REMEDIATION_DEVELOPER
    • José Valim - REMEDIATION_REVIEWER

Affected packages

Hex / phoenix

Package

Name
phoenix
Purl
pkg:hex/phoenix

Affected ranges

Type
SEMVER
Events
Introduced
1.2.0
Fixed
1.5.16
Type
SEMVER
Events
Introduced
1.6.0-rc.0
Fixed
1.6.18
Type
SEMVER
Events
Introduced
1.7.0-rc.0
Fixed
1.7.25
Type
SEMVER
Events
Introduced
1.8.0-rc.0
Fixed
1.8.17

Affected versions

1.*
1.2.0
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.3.0-rc.0
1.3.0-rc.1
1.3.0-rc.2
1.3.0-rc.3
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.4.0-rc.0
1.4.0-rc.1
1.4.0-rc.2
1.4.0-rc.3
1.4.0
1.4.1
1.4.2
1.4.3
1.4.4
1.4.5
1.4.6
1.4.7
1.4.8
1.4.9
1.4.10
1.4.11
1.4.12
1.4.13
1.4.14
1.4.15
1.4.16
1.4.17
1.4.18
1.5.0-rc.0
1.5.0
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.5.7
1.5.8
1.5.9
1.5.10
1.5.11
1.5.12
1.5.13
1.5.14
1.5.15
1.6.0-rc.0
1.6.0-rc.1
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
1.6.9
1.6.10
1.6.11
1.6.12
1.6.13
1.6.14
1.6.15
1.6.16
1.6.17
1.7.0-rc.0
1.7.0-rc.1
1.7.0-rc.2
1.7.0-rc.3
1.7.0
1.7.1
1.7.2
1.7.3
1.7.4
1.7.5
1.7.6
1.7.7
1.7.8
1.7.9
1.7.10
1.7.11
1.7.12
1.7.13
1.7.14
1.7.15
1.7.16
1.7.17
1.7.18
1.7.19
1.7.20
1.7.21
1.7.22
1.7.23
1.7.24
1.8.0-rc.0
1.8.0-rc.1
1.8.0-rc.2
1.8.0-rc.3
1.8.0-rc.4
1.8.0
1.8.1
1.8.2
1.8.3
1.8.4
1.8.5
1.8.6
1.8.7
1.8.8
1.8.9
1.8.10
1.8.11
1.8.12
1.8.13
1.8.14
1.8.15
1.8.16

Database specific

source
"https://cna.erlef.org/osv/EEF-CVE-2026-128361.json"

Git / github.com/phoenixframework/phoenix

Affected versions

v1.*
v1.2.0
v1.3.0
v1.3.0-rc.0
v1.3.0-rc.1
v1.3.0-rc.2
v1.3.0-rc.3
v1.4.0
v1.4.0-rc.0
v1.4.0-rc.1
v1.4.0-rc.2
v1.4.0-rc.3
v1.5.0
v1.5.0-rc.0
v1.5.1
v1.5.10
v1.5.11
v1.5.12
v1.5.13
v1.5.15
v1.5.2
v1.5.3
v1.5.4
v1.5.5
v1.5.6
v1.5.7
v1.5.8
v1.5.9
v1.6.0
v1.6.0-rc.0
v1.6.0-rc.1
v1.6.1
v1.6.10
v1.6.11
v1.6.12
v1.6.13
v1.6.14
v1.6.15
v1.6.16
v1.6.17
v1.6.2
v1.6.3
v1.6.4
v1.6.5
v1.6.6
v1.6.7
v1.7.0
v1.7.0-rc.0
v1.7.0-rc.1
v1.7.0-rc.2
v1.7.0-rc.3
v1.7.1
v1.7.10
v1.7.11
v1.7.12
v1.7.13
v1.7.14
v1.7.15
v1.7.16
v1.7.18
v1.7.19
v1.7.2
v1.7.20
v1.7.22
v1.7.23
v1.7.24
v1.7.3
v1.7.4
v1.7.5
v1.7.6
v1.7.7
v1.7.8
v1.7.9
v1.8.0
v1.8.0-rc.0
v1.8.0-rc.1
v1.8.0-rc.2
v1.8.0-rc.3
v1.8.0-rc.4
v1.8.1
v1.8.11
v1.8.12
v1.8.13
v1.8.14
v1.8.15
v1.8.16
v1.8.2
v1.8.3
v1.8.4
v1.8.5
v1.8.6
v1.8.7
v1.8.8
v1.8.9

Database specific

source
"https://cna.erlef.org/osv/EEF-CVE-2026-128361.json"