Skip to content
Heist/ feed
Back to feed
Medium

Unvalidated HTTP/1 request-target authority lets a client choose conn.host and conn.port in Bandit

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-105660
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 01:16 UTC · Revision 1

Source evidence

Unvalidated HTTP/1 request-target authority lets a client choose conn.host and conn.port in Bandit

core-osv · Original source

Published 15 Oct 2026, 18:37 UTC

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.

osv:CVE-2026-105660
Complete source record
{
  "id": "cc1fd6825beab675af380df4172cc48db4006fcee0676aaa99b4f4378c11a194",
  "url": "https://osv.dev/vulnerability/CVE-2026-105660",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Unvalidated HTTP/1 request-target authority lets a client choose conn.host and conn.port in Bandit",
    "summary": "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.",
    "evidence": "osv:CVE-2026-105660",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-105660",
      "aliases": [
        "CVE-2026-105660",
        "EEF-CVE-2026-105660",
        "GHSA-v53v-9hvg-37jf"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/mtrudel/bandit",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0e3edda0edf6322e9164b827c6d3ddecd080ff2e"
                },
                {
                  "fixed": "6ea80210137b3f69caf65f67398934259dc365d0"
                },
                {
                  "introduced": "e197c791f440ec3519e4d6a6f123dca8505602fd"
                },
                {
                  "fixed": "d6daa4a950604a9bc91b49da785747cff370ca66"
                },
                {
                  "fixed": "0e3edda0edf6322e9164b827c6d3ddecd080ff2e"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0e3edda0edf6322e9164b827c6d3ddecd080ff2e"
                      },
                      {
                        "fixed": "6ea80210137b3f69caf65f67398934259dc365d0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0.6.0"
                      },
                      {
                        "fixed": "1.13.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "fixed": "0e3edda0edf6322e9164b827c6d3ddecd080ff2e"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "6ea80210137b3f69caf65f67398934259dc365d0"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.12.5",
            "1.12.4",
            "1.12.3",
            "1.12.1",
            "1.12.0",
            "1.11.1",
            "1.11.0",
            "1.10.4",
            "1.10.3",
            "1.10.2",
            "1.10.1",
            "1.10.0",
            "1.9.0",
            "1.8.0",
            "1.7.0",
            "1.6.11",
            "1.6.10",
            "1.6.9",
            "1.6.8",
            "1.6.7",
            "1.6.6",
            "1.6.5",
            "1.6.4",
            "1.6.3",
            "1.6.2",
            "1.6.1",
            "1.6.0",
            "1.5.7",
            "1.5.6",
            "1.5.5",
            "1.5.4",
            "1.5.3",
            "1.5.2",
            "1.5.1",
            "1.5.0",
            "1.4.2",
            "1.4.1",
            "1.4.0",
            "1.3.0",
            "1.2.3",
            "1.2.0",
            "1.1.3",
            "1.1.2",
            "1.1.1",
            "1.1.0",
            "1.0.0",
            "1.0.0-pre.18",
            "1.0.0-pre.17",
            "1.0.0-pre.16",
            "1.0.0-pre.15",
            "1.0.0-pre.14",
            "1.0.0-pre.13",
            "1.0.0-pre.12",
            "1.0.0-pre.11",
            "1.0.0-pre.10",
            "1.0.0-pre.9",
            "1.0.0-pre.8",
            "1.0.0-pre.7",
            "1.0.0-pre.6",
            "1.0.0-pre.5",
            "1.0.0-pre.4",
            "1.0.0-pre.3",
            "1.0.0-pre.2",
            "1.0.0-pre.1",
            "0.7.7",
            "0.7.6",
            "0.7.5",
            "0.7.4",
            "0.7.3",
            "0.7.2",
            "0.7.1",
            "0.7.0",
            "0.6.11",
            "0.6.10",
            "0.6.9",
            "0.6.8",
            "0.6.7",
            "0.6.6",
            "0.6.5",
            "0.6.4",
            "0.6.3",
            "0.6.2",
            "0.6.1",
            "0.6.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-105660.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.740545077Z",
      "provider": "osv",
      "references": [
        "https://cna.erlef.org/cves/CVE-2026-105660.html",
        "https://github.com",
        "https://osv.dev/vulnerability/EEF-CVE-2026-105660",
        "https://repo.hex.pm",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/105xxx/CVE-2026-105660.json",
        "https://github.com/mtrudel/bandit/security/advisories/GHSA-v53v-9hvg-37jf",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-105660",
        "https://github.com/mtrudel/bandit/commit/0e3edda0edf6322e9164b827c6d3ddecd080ff2e",
        "https://github.com/mtrudel/bandit/commit/6ea80210137b3f69caf65f67398934259dc365d0",
        "https://github.com/mtrudel/bandit"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-1286"
        ],
        "cna_assigner": "EEF",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/105xxx/CVE-2026-105660.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-105660",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 491536,
  "published_at": "2026-10-15T18:37:02.485+00:00"
}