CVE-2026-39807: CWE-807 Reliance on Untrusted Inputs in a Security Decision in mtrudel bandit
Reliance on Untrusted Inputs in a Security Decision vulnerability in mtrudel bandit allows unauthenticated transport-state spoofing on plaintext HTTP connections. '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. Downstream 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. This issue affects bandit: from 1.0.0 before 1.11.0.
AI Analysis
Technical Summary
The vulnerability arises from the function 'Elixir.Bandit.Pipeline':determine_scheme/2, which returns the client-supplied URI scheme verbatim, ignoring whether the transport is actually secure. Attackers can exploit this by sending HTTP/1.1 absolute-form requests or HTTP/2 :scheme pseudo-headers over plaintext TCP connections, causing bandit to incorrectly set conn.scheme to :https. This misrepresentation leads downstream Plug consumers, such as Plug.SSL, to skip necessary HTTPS redirects, send cookies with the secure flag over plaintext, and produce inaccurate audit logs. The flaw is classified as CWE-807 (Reliance on Untrusted Inputs in a Security Decision) and affects bandit versions from 1.0.0 up to but not including 1.11.0.
Potential Impact
An attacker can cause the server and downstream components to believe a plaintext HTTP connection is secure HTTPS, leading to insecure cookie transmission, bypass of HTTPS enforcement mechanisms, and inaccurate security logging. This undermines transport security assumptions and may facilitate further attacks relying on these incorrect security decisions. However, exploitation requires control over the client request and only affects plaintext HTTP connections.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid relying solely on conn.scheme for security decisions on plaintext HTTP connections. Consider additional validation of transport security outside of client-supplied scheme values or enforce TLS to prevent plaintext connections. Monitor vendor communications for updates and patches addressing this issue.
CVE-2026-39807: CWE-807 Reliance on Untrusted Inputs in a Security Decision in mtrudel bandit
Description
Reliance on Untrusted Inputs in a Security Decision vulnerability in mtrudel bandit allows unauthenticated transport-state spoofing on plaintext HTTP connections. '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. Downstream 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. This issue affects bandit: from 1.0.0 before 1.11.0.
CVSS v4.0
Score 6.3medium
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from the function 'Elixir.Bandit.Pipeline':determine_scheme/2, which returns the client-supplied URI scheme verbatim, ignoring whether the transport is actually secure. Attackers can exploit this by sending HTTP/1.1 absolute-form requests or HTTP/2 :scheme pseudo-headers over plaintext TCP connections, causing bandit to incorrectly set conn.scheme to :https. This misrepresentation leads downstream Plug consumers, such as Plug.SSL, to skip necessary HTTPS redirects, send cookies with the secure flag over plaintext, and produce inaccurate audit logs. The flaw is classified as CWE-807 (Reliance on Untrusted Inputs in a Security Decision) and affects bandit versions from 1.0.0 up to but not including 1.11.0.
Potential Impact
An attacker can cause the server and downstream components to believe a plaintext HTTP connection is secure HTTPS, leading to insecure cookie transmission, bypass of HTTPS enforcement mechanisms, and inaccurate security logging. This undermines transport security assumptions and may facilitate further attacks relying on these incorrect security decisions. However, exploitation requires control over the client request and only affects plaintext HTTP connections.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid relying solely on conn.scheme for security decisions on plaintext HTTP connections. Consider additional validation of transport security outside of client-supplied scheme values or enforce TLS to prevent plaintext connections. Monitor vendor communications for updates and patches addressing this issue.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-04-07T12:28:54.916Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69f5124bcbff5d86105840e4
Added to database: 5/1/2026, 8:51:23 PM
Last enriched: 5/27/2026, 8:06:12 PM
Last updated: 6/15/2026, 11:15:15 PM
Views: 88
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.