/

CVE-2026-61593

Severity:

HIGH RISK

(8.1)

Cross-Site Request Forgery (CWE-352) in djust SSE Endpoints

CVE-2026-61593

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery

CWE:

CWE-352

Impact:

Unauthorized state-changing actions

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A cross-site request forgery vulnerability in djust's Server-Sent Events (SSE) endpoints allows a cross-origin webpage to interact with a victim's cookie-authenticated LiveView session. If the victim is authenticated and the SSE transport is enabled, an attacker may cause state-changing event handlers to run with the victim's privileges.

Affected context

The issue occurs in djust deployments using the SSE transport when client-to-server POST endpoints accept cross-origin requests without CSRF protection and the stream endpoint does not verify the request Origin. A client-selected session identifier is checked only for UUID formatting, so it does not provide proof that the request originated from the legitimate application.

Exploit preconditions

  • Attack surface: SSE stream and client-to-server message endpoints exposed by the djust application
  • Required access: A victim must have an active, cookie-authenticated session; the attacker generally needs only to control or publish a cross-origin webpage
  • Trigger point: The victim's browser is induced to open the SSE stream and submit a message request to the associated endpoint
  • Why exploitation is possible: Missing Origin validation and CSRF protection allow cross-origin requests, while a JSON body sent with a simple-request content type can avoid a browser preflight

Why this happens

The vulnerability results from treating browser cookies as sufficient authorization for SSE session actions without validating the request's origin or requiring an effective CSRF token. The stream endpoint creates and mounts a LiveView session based on a client-supplied identifier, while the POST endpoints accept cross-origin state-changing requests. This maps to CWE-352: Cross-Site Request Forgery, because an attacker-controlled origin can cause an authenticated browser to submit actions to the application.

Potential impact

  • Unauthorized state changes in LiveView event handlers
  • Actions performed with the victim's application privileges
  • Modification or deletion of application-managed data, depending on exposed handlers
  • Abuse of authenticated workflows or business operations
  • Potential data integrity or account-impacting consequences

General mitigation guidance

Mitigation typically focuses on enforcing origin and request-integrity checks across every SSE endpoint.

Common defensive patterns include:

  • Validate the Origin header against an explicit, trusted allowlist for both stream and message requests
  • Require an appropriate JSON content type for state-changing POST requests
  • Use framework-supported CSRF protections or unpredictable, server-validated CSRF tokens
  • Avoid treating client-chosen session identifiers as authentication or request-integrity credentials
  • Disable the SSE transport when its security controls cannot be consistently enforced
  • Apply least privilege to authenticated sessions and sensitive event handlers
  • Enforce equivalent origin policy at a trusted reverse proxy where appropriate

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis rules flagging CSRF exemptions on state-changing endpoints
  • Code review checks for missing Origin or Referer validation on cookie-authenticated SSE and WebSocket-like interfaces
  • Tests that submit cross-origin requests with simple-request content types and verify rejection
  • Policy checks requiring CSRF tokens or explicit origin allowlists for browser-accessible state-changing routes
  • Runtime monitoring for rejected and accepted cross-origin requests, unusual SSE session creation, and unexpected event activity
  • Automated security review tools that model browser credential behavior and CORS preflight conditions

Sources

SourceLink
github.comgithub.com/djust-org/djust/releases/tag/v1.0.7
github.comgithub.com/djust-org/djust/security/advisories/GHSA-pg97-jvmf-qfvc

Frequently asked

questions

Yes, in the sense that an attacker-controlled website may trigger the victim's browser remotely. The attack still depends on the victim visiting that page while authenticated to a djust application that exposes the affected SSE transport.

The attacker generally needs control of a cross-origin webpage, not direct access to the victim's account or server. The victim's browser supplies the application cookies when making the affected requests.

Enforce an explicit trusted-origin allowlist on all SSE stream and message endpoints, require an appropriate content type, and use framework-supported CSRF or equivalent request-integrity protections for state-changing actions.

Treat every browser-accessible state-changing endpoint as CSRF-sensitive, avoid relying on client-selected identifiers, test simple cross-origin requests, and enforce origin and credential policies consistently at the application or trusted proxy layer.

Find out what's already
exploitable in your codebase.