CVE-2026-55571: djust authentication bypass: a login_required / on_mount LiveView mount redirect does not close the WebSocket, allowing an unauthenticated client to dispatch event-handler calls

Published Aug 25, 2026
·
Updated

Impact

djust's LiveViewConsumer mounts a LiveView over a WebSocket. When a view is gated (loginrequired / permissionrequired, or an onmount hook that returns a redirect) and the connecting user is not authorized, the consumer sent the client a {"type":"navigate","to":...} redirect frame and then returned — without closing the socket and without clearing self.viewinstance. Only the PermissionDenied branch closed the connection (close(4403)).

A real browser obeys the navigate frame and leaves, hiding the problem. A raw WebSocket client that ignores the redirect keeps an open, mounted socket. Because handleevent did not re-check authentication/authorization after mount, that client could then send {"type":"event", ...} frames and invoke any @eventhandler method on the gated view with no authenticated session — an authentication bypass on the live mutation path.

Who is affected: apps that expose LiveViews gated by loginrequired / permissionrequired / a redirecting onmount hook, where the gated view's event handlers perform sensitive reads or mutations and do not independently re-verify the user. Exploitation requires a non-browser WebSocket client and knowledge (or enumeration) of the view path and event names.

Patches

Fixed in djust 1.0.4 (commit 1ae8aa9, PR #1780). Both the auth-redirect and onmount-hook-redirect branches of handlemount now send the navigate frame and then close(code=4403) and clear self.viewinstance, mirroring the existing PermissionDenied branch. Public / authorized mounts are unchanged. The same path is reachable via handleliveredirectmount (which delegates to handlemount) and is covered by the same fix.

1.0.4 also adds an opt-in defense-in-depth control, LIVEVIEWCONFIG['reauthonevent'] = True (default OFF), which re-resolves the user from the session and re-runs the view's auth check on every event for gated views.

Workarounds

Upgrade to 1.0.4. If you cannot upgrade immediately, on affected versions ensure that every @eventhandler on a gated LiveView independently verifies the request user is authenticated and authorized (e.g. check request.user.isauthenticated / permissions at the top of each handler), since the framework does not re-check after mount on < 1.0.4. Alternatively, override the consumer's handlemount to await self.close(code=4403) after emitting an auth redirect.

Proof of concept

Using Channels' WebsocketCommunicator against LiveViewConsumer.asasgi() with an anonymous scope, mount a loginrequired view: the server emits a navigate frame but the socket stays open. Sending a subsequent {"type":"event", "handler":"<mutatinghandler>", ...} frame reaches the handler and executes it without an authenticated session. On 1.0.4 the socket is closed with code 4403 immediately after the redirect and the event frame is rejected. (Regression test: tests/testwsauthclosesocket.py.)

Credits

Discovered internally during the djust v1.1.0 WebSocket-auth security review.

Other sources

djust provides Phoenix LiveView-style reactive server-side rendering for Django with Rust-powered performance. Prior to 1.0.4, LiveViewConsumer.handlemount sends a {"type":"navigate","to":...} frame when loginrequired, permissionrequired, or a redirecting onmount hook denies a LiveView mount, but returns without closing the WebSocket or clearing self.viewinstance. A browser follows the redirect, but a raw WebSocket client can ignore it and retain the mounted socket. Because LiveViewConsumer.handleevent does not recheck authentication or authorization, the client can send {"type":"event",...} frames that invoke @eventhandler methods without an authenticated session, including through handleliveredirectmount, enabling unauthorized sensitive reads or mutations. This issue is fixed in version 1.0.4.

MITRE

Affected Software

2 affected componentsFixes available
djust LiveViewConsumer<1.0.4
pip/djust<1.0.4
1.0.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/djust to a version that resolves this vulnerability.

    Fixed in 1.0.4
  2. Upgrade

    Upgrade djust to a version that resolves this vulnerability.

    Fixed in 1.0.4Patch 1ae8aa9
  3. Configuration

    Enable defense-in-depth by setting LIVEVIEW_CONFIG['reauth_on_event'] = True (default OFF) so the user is re-resolved from the session and the view auth check is re-run on every event for gated views.

    djust LiveViewConsumer (LiveViewConfig) LIVEVIEW_CONFIG['reauth_on_event'] = True
  4. Configuration

    On affected versions < 1.0.4, ensure every @event_handler on a gated LiveView (login_required / permission_required / redirecting on_mount) independently verifies the request user is authenticated and authorized at the top of the handler, since LiveViewConsumer.handle_event does not re-check after mount.

    djust gated LiveView event handlers (@event_handler) request.user.is_authenticated / permissions re-check = Performed at top of each handler

Event History

Aug 25, 2026
CVE Published
via MITRE·04:05 PM
Data Sourced
via MITRE·04:05 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·04:06 PM
Data Sourced
via GitHub·04:06 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications exposing LiveViews protected by login_required, permission_required, or an on_mount hook that redirects can be affected. Risk is highest where event handlers on those views perform sensitive reads or mutations without independently verifying the user.

2

What does an attacker need to exploit the issue?

An attacker needs a raw WebSocket client that ignores the redirect frame sent after an unauthorized mount attempt. The client can then keep the mounted socket open and send event frames to invoke event-handler methods without an authenticated session.

3

How can I assess whether a particular LiveView is at risk?

Review gated LiveViews for event handlers that rely solely on mount-time authentication or authorization. Handlers that can read sensitive data or make state changes and do not re-check the user are the relevant exposure points.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203