Vulnerability description

Improper Check for Unusual or Exceptional Conditions vulnerability in phoenixframework phoenix (Presence JavaScript client) allows an attacker with ordinary channel access to cause a persistent client-side denial of service against every viewer of a presence channel topic.

This vulnerability is associated with program files assets/js/phoenix/presence.js and program routines Presence.syncState and Presence.syncDiff.

The Phoenix JavaScript presence client checks whether a presence already exists with a bare truthiness test (state[key]) instead of an own-property check. Presence keys can be attacker-controlled, because applications track presences under a username or id supplied by the client. A user who joins a channel choosing a key that is an Object.prototype member name (__proto__, constructor, toString, hasOwnProperty, and similar) makes that lookup return JavaScript's built-in Object.prototype instead of undefined. Because the prototype is truthy, the code treats it as an existing presence and reads .metas.map(...) off it, which throws an uncaught TypeError.

The exception propagates out of the presence message handler, so the local state is never updated and onSync() never fires. Because the malicious key is tracked on the server, it is re-pushed on every presence update and keeps re-throwing, so presence sync stays broken for every viewer of that channel topic until the attacker leaves. Both syncState and syncDiff use the same unsafe existence-check pattern. The impact is limited to the affected topic and is a read-time confusion of the prototype object, not a mutation of Object.prototype (it is not prototype pollution).

This issue affects phoenix: from 1.2.0-rc.0 before 1.5.15, from 1.6.0-rc.0 before 1.6.17, from 1.7.0-rc.0 before 1.7.24, and from 1.8.0-rc.0 before 1.8.9.

Affected

pkg:hex/phoenix

Module Source File Routine
Presence assets/js/phoenix/presence.js Presence.syncState
Presence.syncDiff
Status Type Version Changes / Fixed in
affected semver 1.2.0-rc.0 < 1.5.15
affected semver 1.6.0-rc.0 < 1.6.17
affected semver 1.7.0-rc.0 < 1.7.24
affected semver 1.8.0-rc.0 < 1.8.9

pkg:npm/phoenix

Module Source File Routine
Presence assets/js/phoenix/presence.js Presence.syncState
Presence.syncDiff
Status Type Version Changes / Fixed in
affected semver 1.2.0-rc.0 < 1.5.15
affected semver 1.6.0-rc.0 < 1.6.17
affected semver 1.7.0-rc.0 < 1.7.24
affected semver 1.8.0-rc.0 < 1.8.9

pkg:github/phoenixframework/phoenix

Module Source File Routine
Presence assets/js/phoenix/presence.js Presence.syncState
Presence.syncDiff
Status Type Version Changes / Fixed in
affected git 2270aaf21b

Configurations

The application must use Phoenix.Presence (or otherwise drive the Phoenix JavaScript presence client) and track presences under keys that are influenced by untrusted client input, for example a username or id chosen by the connecting user. Applications that derive presence keys exclusively from server-controlled, validated values are not affected.

Workarounds

Reject or sanitize presence keys that collide with JavaScript Object.prototype member names (for example __proto__, constructor, prototype, toString, hasOwnProperty) before calling Phoenix.Presence.track, or namespace every presence key with a fixed prefix so that no key can equal a prototype member name. Alternatively, derive presence keys from server-controlled, validated values instead of raw user input.

References

Credits

  • Finder: Peter Ullrich
  • Analyst: Jonatan Männchen
  • Analyst: José Valim
  • Remediation developer: Steffen Deusch

CVE record as JSON:  GET /cves/CVE-2026-56812.json
OSV record as JSON:  GET /osv/EEF-CVE-2026-56812.json