{"containers":{"cna":{"affected":[{"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.Phoenix.Presence'"],"packageName":"phoenix","packageURL":"pkg:hex/phoenix","product":"phoenix","programFiles":["lib/phoenix/presence.ex"],"programRoutines":[{"name":"'Elixir.Phoenix.Presence':handle_info/2"},{"name":"'Elixir.Phoenix.Presence':handle_diff/2"},{"name":"'Elixir.Phoenix.Presence':group/1"}],"repo":"https://github.com/phoenixframework/phoenix","vendor":"phoenixframework","versions":[{"lessThan":"1.5.16","status":"affected","version":"1.2.0","versionType":"semver"},{"lessThan":"1.6.18","status":"affected","version":"1.6.0-rc.0","versionType":"semver"},{"lessThan":"1.7.25","status":"affected","version":"1.7.0-rc.0","versionType":"semver"},{"lessThan":"1.8.17","status":"affected","version":"1.8.0-rc.0","versionType":"semver"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.Phoenix.Presence'"],"packageName":"phoenixframework/phoenix","packageURL":"pkg:github/phoenixframework/phoenix","product":"phoenix","programFiles":["lib/phoenix/presence.ex"],"programRoutines":[{"name":"'Elixir.Phoenix.Presence':handle_info/2"},{"name":"'Elixir.Phoenix.Presence':handle_diff/2"},{"name":"'Elixir.Phoenix.Presence':group/1"}],"repo":"https://github.com/phoenixframework/phoenix","vendor":"phoenixframework","versions":[{"changes":[{"at":"39c1c6bfd0c817f1223c121f61c60a25f66b76cb","status":"unaffected"},{"at":"6609595fb3e37f545c4ac636a369f14b0084bc3d","status":"unaffected"},{"at":"81bc0278c7a4e6204f7e2e0a3b3200e9f1ee5a4b","status":"unaffected"},{"at":"edb702804aeab3a29543668a8be8ea61291c4b75","status":"unaffected"}],"lessThan":"*","status":"affected","version":"44e7618370629df93711cd6169789fd0d8f3678e","versionType":"git"}]}],"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>The application must use <code>Phoenix.Presence</code> and either track presences under a key influenced by client input (such as a name taken from the channel join payload), or define a <code>fetch/2</code> callback that can raise on a tracked key. Applications that track only server-controlled string keys and whose <code>fetch/2</code> cannot raise are not affected.</p>"},{"base64":false,"type":"text/markdown","value":"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."}],"value":"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."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*","versionEndExcluding":"1.5.16","versionStartIncluding":"1.2.0","vulnerable":true},{"criteria":"cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*","versionEndExcluding":"1.6.18","versionStartIncluding":"1.6.0-rc.0","vulnerable":true},{"criteria":"cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*","versionEndExcluding":"1.7.25","versionStartIncluding":"1.7.0-rc.0","vulnerable":true},{"criteria":"cpe:2.3:a:phoenixframework:phoenix:*:*:*:*:*:*:*:*","versionEndExcluding":"1.8.17","versionStartIncluding":"1.8.0-rc.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"reporter","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Steffen Deusch"},{"lang":"en","type":"remediation reviewer","value":"José Valim"}],"dateAssigned":"2026-11-20T10:53:30.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Improper Input Validation vulnerability in phoenixframework phoenix (<code>Phoenix.Presence</code>) allows an attacker who can join a channel to cause a denial of service via a non-string presence key.</p>\n<p><code>track/3,4</code> accepts any term as the presence key, such as a JSON object taken from a join payload. The key is converted with <code>to_string/1</code> only later, in <code>Phoenix.Presence.group/1</code>, which raises <code>Protocol.UndefinedError</code> on a map. <code>group/1</code> runs whenever presences are listed and when each presence diff is broadcast, together with the application's <code>fetch/2</code>, 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.</p>\n<p>From 1.7.0 the diff runs in a <code>Task.Supervisor.async</code> task linked to the tracker shard, and <code>Phoenix.Presence.handle_info/2</code> 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.</p>\n<p>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.</p>"},{"base64":false,"type":"text/markdown","value":"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.\n\n`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.\n\nFrom 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.\n\nThis 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."}],"value":"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.\n\ntrack/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.\n\nFrom 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.\n\nThis 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."}],"impacts":[{"capecId":"CAPEC-153","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>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.</p>"},{"base64":false,"type":"text/markdown","value":"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."}],"value":"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."}]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":8.2,"baseSeverity":"HIGH","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-20","description":"CWE-20 Improper Input Validation","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-11-21T11:09:51.800Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"references":[{"name":"Unsanitized presence key crashes Presence tracker","tags":["vendor-advisory","related"],"url":"https://github.com/phoenixframework/phoenix/security/advisories/GHSA-pvfx-rx4x-phrr"},{"name":"EEF CNA record for CVE-2026-128361","tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-128361.html"},{"name":"OSV record EEF-CVE-2026-128361","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-128361"},{"name":"Introducing commit 44e7618 in phoenixframework/phoenix","tags":["related"],"url":"https://github.com/phoenixframework/phoenix/commit/44e7618370629df93711cd6169789fd0d8f3678e"},{"name":"Fix commit 39c1c6b in phoenixframework/phoenix","tags":["patch"],"url":"https://github.com/phoenixframework/phoenix/commit/39c1c6bfd0c817f1223c121f61c60a25f66b76cb"},{"name":"Fix commit 6609595 in phoenixframework/phoenix","tags":["patch"],"url":"https://github.com/phoenixframework/phoenix/commit/6609595fb3e37f545c4ac636a369f14b0084bc3d"},{"name":"Fix commit 81bc027 in phoenixframework/phoenix","tags":["patch"],"url":"https://github.com/phoenixframework/phoenix/commit/81bc0278c7a4e6204f7e2e0a3b3200e9f1ee5a4b"},{"name":"Fix commit edb7028 in phoenixframework/phoenix","tags":["patch"],"url":"https://github.com/phoenixframework/phoenix/commit/edb702804aeab3a29543668a8be8ea61291c4b75"}],"source":{"discovery":"EXTERNAL"},"title":"Unsanitized presence key crashes Presence tracker","workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Validate every presence key before passing it to <code>track/3,4</code>, <code>untrack/2,3</code> or <code>update/3,4</code>, 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:</p>\n<pre><code class=\"language-elixir\">def join(\"room:\" &lt;&gt; _, %{\"name\" =&gt; name}, socket) when is_binary(name) do\n  send(self(), {:after_join, name})\n  {:ok, socket}\nend\n</code></pre>\n<p>A <code>fetch/2</code> callback must also not raise on any tracked key.</p>"},{"base64":false,"type":"text/markdown","value":"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:\n\n```elixir\ndef join(\"room:\" <> _, %{\"name\" => name}, socket) when is_binary(name) do\n  send(self(), {:after_join, name})\n  {:ok, socket}\nend\n```\n\nA `fetch/2` callback must also not raise on any tracked key."}],"value":"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:\n\ndef join(\"room:\" <> _, %{\"name\" => name}, socket) when is_binary(name) do\n  send(self(), {:after_join, name})\n  {:ok, socket}\nend\n\nA fetch/2 callback must also not raise on any tracked key."}],"x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Run a Phoenix endpoint with a channel whose join reads <code>name</code> from the join payload and then calls <code>MyPresence.track(socket, name, %{online_at: 1})</code>.</li>\n<li>Join the topic with 15 clients using string names, and confirm <code>MyPresence.list(topic)</code> returns 15 entries.</li>\n<li>Join once more with the payload <code>{\"name\": {\"x\": 1}}</code>.</li>\n<li>The log shows <code>Protocol.UndefinedError</code> from <code>Phoenix.Presence.group/1</code>, then the shard terminating. All 15 clients receive <code>phx_error</code>, and <code>MyPresence.list(topic)</code> returns 0 entries.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"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})`.\n2. Join the topic with 15 clients using string names, and confirm `MyPresence.list(topic)` returns 15 entries.\n3. Join once more with the payload `{\"name\": {\"x\": 1}}`.\n4. 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."}],"value":"* 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}).\n* Join the topic with 15 clients using string names, and confirm MyPresence.list(topic) returns 15 entries.\n* Join once more with the payload {\"name\": {\"x\": 1}}.\n* 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."}],"x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Key accepted.</strong> The <code>track/3,4</code> injected by <code>use Phoenix.Presence</code> passes any term to <code>Phoenix.Tracker.track</code>, which returns <code>{:ok, ref}</code>. The documented pattern <code>Presence.track(socket, name, meta)</code> with <code>name</code> from the join payload lets a client choose a map as the key.</p>\n<p><strong>2. Deferred conversion.</strong> <code>Phoenix.Presence.group/1</code> converts each key with <code>to_string/1</code>. It runs in <code>Phoenix.Presence.list/2</code>, in the calling process, and in <code>handle_diff/2</code> before the application's <code>fetch/2</code>. A map key raises <code>Protocol.UndefinedError</code> there, as does a <code>fetch/2</code> such as the moduledoc's <code>String.to_integer(key)</code> on a non-numeric key.</p>\n<p><strong>3. Topic crash.</strong> While the key stays tracked, every <code>list</code> on the topic raises. The documented <code>after_join</code> that pushes <code>Presence.list(socket)</code> therefore crashes each later joiner's channel. Before 1.7.0, <code>handle_diff/2</code> runs in an unlinked <code>Task.Supervisor.start_child</code> task, so a failing diff only loses that batch of joins and leaves.</p>\n<p><strong>4. Shard crash (1.7.0 and later).</strong> <code>handle_diff/2</code> runs the diff in a <code>Task.Supervisor.async</code> task linked to the tracker shard, and <code>Phoenix.Presence.handle_info/2</code> matches only the task's success reply. The failure terminates the shard (<code>FunctionClauseError</code>), every tracked process linked to it dies, and presence state is wiped. Repeated joins exhaust the supervisor's restart intensity.</p>"},{"base64":false,"type":"text/markdown","value":"**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.\n\n**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.\n\n**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.\n\n**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."}],"value":"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.\n\n2. 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.\n\n3. 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.\n\n4. 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."}]}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-128361","datePublished":"2026-11-21T11:09:51.800Z","dateReserved":"2026-11-18T13:53:21.753Z","dateUpdated":"2026-11-21T11:09:51.800Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"}