PAGI::FastAPI's to_app Builder Can Bypass Registered Middleware
PAGI::FastAPI versions from 1.0.0 before 1.4.0 can serve requests without authentication or CSRF middleware when an application is built with to_app . The issue is tracked as CVE-2026-130488. The module's add_middleware path keeps middleware objects in a separate stack, while the to_app builder does not reliably connect that stack to the application that serves requests. The fixed release is 1.4.0.
The failure is easy to miss in development because the application may still start. A test that calls a route directly can return a successful response without proving that the production request path has the intended middleware. The risk is highest for APIs that rely on middleware for authentication, CSRF checks, audit logging, or tenant selection. A route handler may be perfectly correct and still receive a request that never passed the gate its author expected.
Inventory every application built with to_app .…