Intel

AIKIDO-2026-106897

bandit is vulnerable to Improper Input Validation

CVE-2026-105660Published Oct 30, 2026
October 30, 2026

55

CVE Score

Medium

Improper Input Validation

Are you affected? Scan for Free

TL;DR

In bandit, the authority of an HTTP/1 absolute-form or authority-form (CONNECT) request target is not validated. Although the Host header is validated and rejected with a 400 when malformed, the request-target authority takes precedence (per RFC 9112) and is passed unchecked to the application as conn.host and conn.port. An unauthenticated remote attacker can set these to values outside the RFC 3986 host grammar, such as userinfo (good.example@evil.example), NUL/DEL/non-ASCII bytes, invalid IP literals or ports outside 1..65535. For CONNECT, conn.port is left as an unparsed binary, which makes Plug.Conn.request_url/1 raise. Applications that build absolute URLs from conn.host (for example password-reset or verification links via Plug.Conn.request_url/1 or Phoenix URL helpers) may emit links pointing to an attacker-chosen host.

How do I fix this?

Upgrade the bandit library to the patch version. As a workaround, add a plug ahead of any code that reads conn.host or conn.port that checks conn.host against an allow-list of the hostnames your application serves, verifies conn.port is an integer, and halts the request with a 400 response otherwise.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application reads conn.host or conn.port, for example to build absolute URLs.

Package

Versions

0.6.0 - 1.12.5

Fixed in 1.13.0

Background info

bandit is vulnerable to Improper Input Validation in versions 0.6.0 - 1.12.5.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea