---
id: "CVE-2026-110314"
kind: "vulnerability"
aliases: ["CVE-2026-110314"]
title: "Bandit: WebSocket handlers keep running after server closes connection"
severity: "medium"
cvss: 6.3
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["bandit", "elixir", "phoenix", "runtime", "websocket"]
not_affected_if: ["bandit-1.14-or-later", "no-websockets"]
published_at: "2026-10-26T14:16:25+00:00"
first_seen_at: "2026-10-26T14:30:36+00:00"
updated_at: "2026-10-26T14:32:39+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-110314", "first_seen_at": "2026-10-26T14:30:36+00:00"}]
---

# Bandit: WebSocket handlers keep running after server closes connection

After a WebSock handler returns a stop tuple, Bandit keeps the connection open and still passes later client frames and messages to the handler. A remote client can therefore trigger handler actions that the server meant to have ended, including admin-only actions if the connection was refused after a failed token check.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `mix deps | grep bandit` or check `mix.lock` for the bandit version in use
- Search the app for WebSock modules (`@behaviour WebSock`) that return `{:stop, ...}` from init/1 or handle_in/2 and rely on it to block later actions

## Fix

- Upgrade bandit to `1.14.0` or later

## Timeline

- 2026-10-26T14:30:36+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-110314

## From the sources

Client-Side Enforcement of Server-Side Security vulnerability in the WebSocket connection handling of mtrudel bandit allows a remote client to keep running WebSock handler code after the server has stopped its connection, via data frames sent after ignoring the server's Close frame.

When a WebSock callback returns {:stop, ...}, Bandit.WebSocket.Connection calls terminate/2, sends Close and shuts down the write side, but keeps the connection process running in a :closing state. handle_frame/3 and handle_info/3 never check that state, so later frames still reach handle_in/2 and later messages reach handle_info/2, with the state from the stop tuple, until the client sends Close, TCP drops or the idle timeout fires. A client refused in init/1 after a failed token check could still run an admin-only action.

This issue affects bandit: from 0.5.1 before 1.14.0.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
