{"id":"CVE-2026-39807","state":"PUBLISHED","title":"Client-supplied URI scheme trusted without transport verification in bandit","description":"Reliance on Untrusted Inputs in a Security Decision vulnerability in mtrudel bandit allows unauthenticated transport-state spoofing on plaintext HTTP connections.\n\n'Elixir.Bandit.Pipeline':determine_scheme/2 in lib/bandit/pipeline.ex returns the client-supplied URI scheme verbatim, ignoring the transport's secure? flag. HTTP/1.1 absolute-form request targets (e.g. GET https://victim/path HTTP/1.1) and the HTTP/2 :scheme pseudo-header are both attacker-controlled strings that flow through this function. Over a plaintext TCP connection, a client can declare https and Bandit will set conn.scheme = :https even though no TLS was negotiated.\n\nDownstream Plug consumers that branch on conn.scheme are silently misled: Plug.SSL's already-secure branch skips its HTTP→HTTPS redirect, cookies emitted with secure: true are sent over plaintext, audit logs record requests as having arrived over HTTPS, and CSRF/SameSite gating may make incorrect decisions.\n\nThis issue affects bandit: from 1.0.0 before 1.11.0.","publishedAt":"2026-05-01T20:34:22.832Z","updatedAt":"2026-05-27T15:41:35.917Z","severity":{"score":6.3,"label":"Medium","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","source":"EEF"},"assigner":"EEF","products":["mtrudel bandit"],"affected":[{"vendor":"mtrudel","product":"bandit","packageName":"bandit","packageURL":"pkg:hex/bandit","defaultStatus":"unaffected","versions":[{"version":"1.0.0","status":"affected","lessThan":"1.11.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.Pipeline'"],"programFiles":["lib/bandit/pipeline.ex"],"programRoutines":[{"name":"'Elixir.Bandit.Pipeline':determine_scheme/2"}],"repo":"https://github.com/mtrudel/bandit"},{"vendor":"mtrudel","product":"bandit","packageName":"mtrudel/bandit","packageURL":"pkg:github/mtrudel/bandit","defaultStatus":"unaffected","versions":[{"version":"ff2f829326cd5dcf7335939aef9775269d881e28","status":"affected","lessThan":"45feea20dea8af7ffd7245271107b695c040e667","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.Pipeline'"],"programFiles":["lib/bandit/pipeline.ex"],"programRoutines":[{"name":"'Elixir.Bandit.Pipeline':determine_scheme/2"}],"repo":"https://github.com/mtrudel/bandit"}],"references":["https://github.com/mtrudel/bandit/security/advisories/GHSA-375f-4r2h-f99j","https://cna.erlef.org/cves/CVE-2026-39807.html","https://osv.dev/vulnerability/EEF-CVE-2026-39807","https://github.com/mtrudel/bandit/commit/45feea20dea8af7ffd7245271107b695c040e667"],"weaknesses":["CWE-807"],"ingestedAt":"2026-10-29T20:11:50.837Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/39xxx/CVE-2026-39807.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-39807","state":"PUBLISHED","datePublished":"2026-05-01T20:34:22.832Z","dateUpdated":"2026-05-27T15:41:35.917Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-04-07T12:28:54.916Z"},"containers":{"cna":{"title":"Client-supplied URI scheme trusted without transport verification in bandit","descriptions":[{"lang":"en","value":"Reliance on Untrusted Inputs in a Security Decision vulnerability in mtrudel bandit allows unauthenticated transport-state spoofing on plaintext HTTP connections.\n\n'Elixir.Bandit.Pipeline':determine_scheme/2 in lib/bandit/pipeline.ex returns the client-supplied URI scheme verbatim, ignoring the transport's secure? flag. HTTP/1.1 absolute-form request targets (e.g. GET https://victim/path HTTP/1.1) and the HTTP/2 :scheme pseudo-header are both attacker-controlled strings that flow through this function. Over a plaintext TCP connection, a client can declare https and Bandit will set conn.scheme = :https even though no TLS was negotiated.\n\nDownstream Plug consumers that branch on conn.scheme are silently misled: Plug.SSL's already-secure branch skips its HTTP→HTTPS redirect, cookies emitted with secure: true are sent over plaintext, audit logs record requests as having arrived over HTTPS, and CSRF/SameSite gating may make incorrect decisions.\n\nThis issue affects bandit: from 1.0.0 before 1.11.0."}],"affected":[{"vendor":"mtrudel","product":"bandit","packageName":"bandit","packageURL":"pkg:hex/bandit","defaultStatus":"unaffected","versions":[{"version":"1.0.0","status":"affected","lessThan":"1.11.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.Pipeline'"],"programFiles":["lib/bandit/pipeline.ex"],"programRoutines":[{"name":"'Elixir.Bandit.Pipeline':determine_scheme/2"}],"repo":"https://github.com/mtrudel/bandit"},{"vendor":"mtrudel","product":"bandit","packageName":"mtrudel/bandit","packageURL":"pkg:github/mtrudel/bandit","defaultStatus":"unaffected","versions":[{"version":"ff2f829326cd5dcf7335939aef9775269d881e28","status":"affected","lessThan":"45feea20dea8af7ffd7245271107b695c040e667","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.Pipeline'"],"programFiles":["lib/bandit/pipeline.ex"],"programRoutines":[{"name":"'Elixir.Bandit.Pipeline':determine_scheme/2"}],"repo":"https://github.com/mtrudel/bandit"}],"references":[{"url":"https://github.com/mtrudel/bandit/security/advisories/GHSA-375f-4r2h-f99j","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-39807.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-39807","tags":["related"]},{"url":"https://github.com/mtrudel/bandit/commit/45feea20dea8af7ffd7245271107b695c040e667","tags":["patch"]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":6.3,"baseSeverity":"MEDIUM","privilegesRequired":"NONE","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","version":"4.0","vulnAvailabilityImpact":"NONE","vulnConfidentialityImpact":"LOW","vulnIntegrityImpact":"LOW"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-807","description":"CWE-807 Reliance on Untrusted Inputs in a Security Decision","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-05-27T15:41:35.917Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>The vulnerable system must be accepting plaintext (non-TLS) HTTP connections, either directly or via h2c. Deployments that exclusively use TLS are not affected.</p>"}],"value":"The vulnerable system must be accepting plaintext (non-TLS) HTTP connections, either directly or via h2c. Deployments that exclusively use TLS are not affected."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*","versionEndExcluding":"1.11.0","versionStartIncluding":"1.0.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Mat Trudel"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"}],"impacts":[{"capecId":"CAPEC-220","descriptions":[{"lang":"en","value":"CAPEC-220 Client-Server Protocol Manipulation"}]}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"cvelib 1.8.0"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/mtrudel/bandit/security/advisories/GHSA-375f-4r2h-f99j","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-05-02T01:17:52.498343Z","id":"CVE-2026-39807","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-05-02T01:18:10.776Z"}}]}}}