Unvalidated HTTP/1 request-target authority lets a client choose conn.host and conn.port in Bandit
Improper Validation of Syntactic Correctness of Input vulnerability in mtrudel bandit allows an unauthenticated remote attacker to set conn.host and conn.port to values outside the RFC 3986 host grammar via the authority of an HTTP/1 absolute-form or authority-form request target. Bandit validates the Host header and answers 400 when it is malformed, but when the request target carries its own authority that authority takes precedence, as RFC 9112 requires, and Bandit.Pipeline.determine_host_and_port!/4 in lib/bandit/pipeline.ex passes it to the application unchecked. A request line such as GET http://good.example@evil.example/x HTTP/1.1 with a valid Host header yields a conn.host of good.example@evil.example, and the same path admits NUL, DEL and non-ASCII bytes, invalid IP literals and ports outside 1..65535. The HTTP/1.0 clause needs no Host header at all, and CONNECT places the unparsed port string in conn.port. Applications that build absolute URLs from conn.host, such as through Plug.Conn.request_url/1 or Phoenix URL helpers, emit links whose authority the attacker chose. Message framing is unaffected, and no CR or LF can reach conn.host. This issue affects bandit: from 0.6.0 before 1.13.0.
CVE-2026-105660
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-105660
bandit
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
bandit
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"cpes": [
"cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"
],
"repo": "https://github.com/mtrudel/bandit",
"vendor": "mtrudel",
"modules": [
"'Elixir.Bandit.Pipeline'",
"'Elixir.Bandit.HTTPTransport.Bandit.HTTP1.Socket'"
],
"product": "bandit",
"versions": [
{
"status": "affected",
"version": "0.6.0",
"lessThan": "1.13.0",
"versionType": "semver"
}
],
"packageURL": "pkg:hex/bandit",
"packageName": "bandit",
"programFiles": [
"lib/bandit/pipeline.ex",
"lib/bandit/http1/socket.ex"
],
"collectionURL": "https://repo.hex.pm",
"defaultStatus": "unaffected",
"programRoutines": [
{
"name": "'Elixir.Bandit.Pipeline':determine_host_and_port!/4"
},
{
"name": "'Elixir.Bandit.Pipeline':build_conn!/6"
},
{
"name": "'Elixir.Bandit.HTTPTransport.Bandit.HTTP1.Socket':resolve_request_target!/2"
},
{
"name": "'Elixir.Bandit.HTTPTransport.Bandit.HTTP1.Socket':validate_request_line!/2"
}
]
},
{
"cpes": [
"cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"
],
"repo": "https://github.com/mtrudel/bandit",
"vendor": "mtrudel",
"modules": [
"'Elixir.Bandit.Pipeline'",
"'Elixir.Bandit.HTTPTransport.Bandit.HTTP1.Socket'"
],
"product": "bandit",
"versions": [
{
"status": "affected",
"version": "0e3edda0edf6322e9164b827c6d3ddecd080ff2e",
"lessThan": "6ea80210137b3f69caf65f67398934259dc365d0",
"versionType": "git"
}
],
"packageURL": "pkg:github/mtrudel/bandit",
"packageName": "mtrudel/bandit",
"programFiles": [
"lib/bandit/pipeline.ex",
"lib/bandit/http1/socket.ex"
],
"collectionURL": "https://github.com",
"defaultStatus": "unaffected",
"programRoutines": [
{
"name": "'Elixir.Bandit.Pipeline':determine_host_and_port!/4"
},
{
"name": "'Elixir.Bandit.Pipeline':build_conn!/6"
},
{
"name": "'Elixir.Bandit.HTTPTransport.Bandit.HTTP1.Socket':resolve_request_target!/2"
},
{
"name": "'Elixir.Bandit.HTTPTransport.Bandit.HTTP1.Socket':validate_request_line!/2"
}
]
}
]- Related CVEs
- CVE-2026-105660
Source reference:
/cveMetadata/cveId
Publisher severity
medium
Source reference: /containers/cna/metrics
- Event
- #34412 · Revision 1
- Added to Heist Feed
- Publisher date