Skip to main content
Vulnerability Database/CVE-2026-105660

CVE-2026-105660: Bandit HTTP Server SSRF Vulnerability

CVE-2026-105660 is a Server-Side Request Forgery vulnerability in mtrudel bandit that allows attackers to manipulate host and port values through malformed HTTP requests. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105660 Overview

CVE-2026-105660 is an improper input validation vulnerability [CWE-1286] in the mtrudel bandit HTTP server for Elixir. The flaw allows an unauthenticated remote attacker to control conn.host and conn.port by supplying an HTTP/1 absolute-form or authority-form request target. Bandit validates the Host header but defers to the request-target authority, as RFC 9112 requires, and passes that authority to the application unchecked through Bandit.Pipeline.determine_host_and_port!/4 in lib/bandit/pipeline.ex. Applications that build URLs from conn.host, such as through Plug.Conn.request_url/1 or Phoenix URL helpers, emit links whose authority the attacker chose. The issue affects bandit from 0.6.0 before 1.13.0.

Critical Impact

Attackers can inject arbitrary host and port values into application-generated URLs, enabling open-redirect and link-poisoning attacks against downstream consumers.

Affected Products

  • mtrudel bandit versions 0.6.0 through 1.12.x
  • Elixir applications using Plug.Conn.request_url/1 on top of Bandit
  • Phoenix applications relying on URL helpers backed by Bandit

Discovery Timeline

  • 2026-10-15 - CVE-2026-105660 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-105660

Vulnerability Analysis

Bandit correctly rejects malformed Host headers with HTTP 400, but RFC 9112 instructs servers to prefer the authority in an absolute-form or authority-form request target when one is present. Bandit honored that precedence without re-validating the supplied authority. The function Bandit.Pipeline.determine_host_and_port!/4 extracted the authority and populated conn.host and conn.port directly from attacker-controlled bytes.

A request line such as GET http://good.example@evil.example/x HTTP/1.1 paired with a valid Host header produces a conn.host value of good.example@evil.example. The same path accepts NUL, DEL, and non-ASCII bytes, invalid IP literals, and port values outside the 1..65535 range. HTTP/1.0 requires no Host header at all, and CONNECT requests place the unparsed port string directly in conn.port.

Root Cause

The root cause is missing syntactic validation of the authority component against the RFC 3986 host grammar. Bandit treated the request-target authority as trusted once parsed, bypassing the stricter checks already applied to the Host header.

Attack Vector

An unauthenticated remote attacker sends a crafted HTTP/1 request whose target carries a malicious authority. When the application constructs URLs from conn.host and conn.port, those URLs point to attacker-chosen destinations. Message framing is unaffected, and no CR or LF can reach conn.host, which bounds the impact to authority injection rather than response splitting.

text
   defp build_conn(req) do
     case Adapter.read_headers(req) do
-      {:ok, headers, method, path, req} ->
+      {:ok, headers, method, request_target, req} ->
         %{address: remote_ip} = Adapter.get_peer_data(req)

Source: GitHub commit 0e3edda

text
   @type request_target ::
-          {scheme(), nil | Plug.Conn.host(), nil | Plug.Conn.port_number(), path()}
+          {scheme(), nil | Plug.Conn.host(), nil | Plug.Conn.port_number() | binary(), path()}

Source: GitHub commit 6ea8021

Detection Methods for CVE-2026-105660

Indicators of Compromise

  • HTTP request lines using absolute-form targets with an embedded userinfo component, such as GET http://user@attacker.example/path HTTP/1.1
  • Access logs showing request targets whose authority differs from the Host header value
  • Outbound links, redirects, or emails generated by the application that point to unexpected hostnames

Detection Strategies

  • Inspect reverse proxy and web server logs for request-targets containing @, non-ASCII bytes, NUL, or DEL characters in the authority
  • Compare the parsed request-target authority against the Host header and alert on mismatches
  • Review application telemetry for Plug.Conn.request_url/1 output containing hostnames not on an allowlist

Monitoring Recommendations

  • Enable structured HTTP access logging that captures the full request line, not just the path
  • Forward Bandit and Phoenix application logs to a centralized analytics platform for correlation
  • Alert on anomalous conn.port values outside the 1..65535 range or non-numeric ports from CONNECT requests

How to Mitigate CVE-2026-105660

Immediate Actions Required

  • Upgrade bandit to version 1.13.0 or later across all Elixir and Phoenix deployments
  • Audit application code that reads conn.host, conn.port, or calls Plug.Conn.request_url/1 for downstream trust assumptions
  • Review generated emails, redirects, and webhooks for hostnames that do not match expected domains

Patch Information

The fix is included in bandit1.13.0. The patch reworks request-target handling in lib/bandit/http1/adapter.ex, lib/bandit/http1/handler.ex, and lib/bandit/pipeline.ex to preserve the full request target and validate authority components before populating connection fields. See the GitHub Security Advisory GHSA-v53v-9hvg-37jf and the CNA Advisory for CVE-2026-105660 for details.

Workarounds

  • Place a reverse proxy such as nginx in front of Bandit to strip or reject absolute-form request targets with suspicious authorities
  • Build URLs from a static, server-configured hostname rather than conn.host until the upgrade is applied
  • Reject incoming requests where the request-target authority does not match the Host header
bash
# Update bandit in mix.exs and refresh the lock file
# {:bandit, "~> 1.13"}
mix deps.update bandit
mix deps.get

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.