CVE-2026-61599: djust has an unauthenticated arbitrary module import via the WebSocket/SSE view-mount path

Published Sep 16, 2026
·
Updated

Impact The djust live transport resolves the LiveView to mount from a client-supplied dotted path by calling import(modulepath, ...). The module is imported — running its top-level code (import side effects) — before the framework checks that the resolved object is a LiveView subclass and before any per-view authentication. The LIVEVIEWALLOWEDMODULES allowlist that should contain this is fail-open (if allowedmodules: — skipped when the setting is unset, the framework default) and uses loose startswith matching.

An unauthenticated WebSocket client (the WS handshake does not require auth; per-view auth runs only after import + instantiate) can therefore send a mount / liveredirectmount / urlchange frame (or an SSE mount) with view = "<any.importable.module>.AnyName" and cause the server to import — and execute the top-level code of — any importable Python module by name.

Consequences: server-side execution of arbitrary importable modules' import-time side effects by an unauthenticated client (effectively RCE-by-proxy on any host that has a side-effectful importable module), denial of service (import bombs / expensive dependency trees), and a module/class enumeration oracle via distinct error strings.

Reproduced end-to-end: an unauthenticated WebsocketCommunicator mount frame with the allowlist unset imported and executed a sentinel non-LiveView module before the "not a LiveView subclass" rejection.

Affected code - python/djust/websocket.py handlemount (import of the client view) - python/djust/runtime.py ViewRuntime.dispatchmount / instantiateview (SSE + urlchange path) - python/djust/sse.py SSE mount

Threat-model entry T4 (docs/audits/websocket-auth-2026-06.md) previously noted the default-open allowlist but understated the impact as mere LiveView-class probing; the real primitive is arbitrary-module import + top-level code execution, independent of whether the target is a LiveView.

Patches Fixed by a fail-closed resolution gate (djust.viewresolution.isviewimportallowed): a client view path resolves only if (a) its module is already loaded (sys.modules — so resolving runs no new code; URL-routed views loaded by URLconf at startup keep working with zero config) or (b) it matches LIVEVIEWALLOWEDMODULES on a module-segment boundary (explicit opt-in for lazily-imported views). The gate runs before import at all three sinks (+ defense-in-depth inside instantiateview).

Workarounds Set LIVEVIEWALLOWEDMODULES to the narrow list of modules that contain your mountable LiveView classes. (Note: pre-patch the allowlist is startswith-matched and the import still precedes the subclass check, so this is mitigation, not a complete fix.)

References Reproducer + finding writeup retained privately by the maintainer.

Other sources

djust provides Phoenix LiveView-style reactive server-side rendering for Django with Rust-powered performance. Prior to version 1.0.7, the djust live transport resolves the LiveView to mount from a client-supplied dotted path by calling import(modulepath, ...). The module is imported — running its top-level code (import side effects) — before the framework checks that the resolved object is a LiveView subclass and before any per-view authentication. The LIVEVIEWALLOWEDMODULES allowlist that should contain this is fail-open (if allowedmodules: — skipped when the setting is unset, the framework default) and uses loose startswith matching. An unauthenticated WebSocket client (the WS handshake does not require auth; per-view auth runs only after import + instantiate) can therefore send a mount / liveredirectmount / urlchange frame (or an SSE mount) with view = "<any.importable.module>.AnyName" and cause the server to import — and execute the top-level code of — any importable Python module by name. Version 1.0.7 fixes the issue with a fail-closed resolution gate (djust.viewresolution.isviewimportallowed): a client view path resolves only if (a) its module is already loaded (sys.modules — so resolving runs no new code; URL-routed views loaded by URLconf at startup keep working with zero config) or (b) it matches LIVEVIEWALLOWEDMODULES on a module-segment boundary (explicit opt-in for lazily-imported views). The gate runs before import at all three sinks (+ defense-in-depth inside instantiateview). As a workaround, set LIVEVIEWALLOWEDMODULES to the narrow list of modules that contain your mountable LiveView classes. (Note: pre-patch the allowlist is startswith-matched and the import still precedes the subclass check, so this is mitigation, not a complete fix.)

MITRE

Affected Software

2 affected componentsFixes available
djust<1.0.7
pip/djust<1.0.7
1.0.7

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.7
  2. Upgrade

    Upgrade djust to a version that resolves this vulnerability.

    Fixed in 1.0.7
  3. Configuration

    Configure LIVEVIEW_ALLOWED_MODULES to explicitly list only the modules that contain your mountable LiveView classes (workaround for pre-1.0.7 fail-open + loose startswith matching).

    djust live transport LIVEVIEW_ALLOWED_MODULES = set to the narrow list of modules that contain your mountable LiveView classes

Event History

Sep 16, 2026
Advisory Published
via GitHub·10:09 PM
Data Sourced
via GitHub·10:09 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·10:11 PM
Data Sourced
via MITRE·10:11 PM
DescriptionWeakness

Frequently Asked Questions

1

Are deployments using the default settings affected?

Yes. The module allowlist is skipped when LIVEVIEW_ALLOWED_MODULES is unset, which is the framework default. In versions before 1.0.7, this leaves view-path resolution fail-open.

2

Does an attacker need an account or to pass per-view authentication?

No. The WebSocket handshake does not require authentication, and per-view authentication occurs only after the supplied module has been imported and an object instantiated. An unauthenticated client can send mount-related WebSocket frames or an SSE mount request.

3

What must be present for exploitation to have an effect?

The attacker must be able to name an importable Python module on the server. Importing that module executes its top-level code before djust verifies that the resolved object is a LiveView subclass.

4

Can LIVEVIEW_ALLOWED_MODULES be relied on as a workaround before upgrading?

Not fully. Before 1.0.7, an unset allowlist is ignored and configured entries use loose startswith matching. Upgrade to 1.0.7, which introduces a fail-closed view-resolution gate.

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