Intel

AIKIDO-2026-266800

fastapi-guard is vulnerable to Authentication Bypass

Authentication BypassGHSA-f2vm-w8gq-h378 Published Yesterday

74

High Risk

This Affects:

PYTHONfastapi-guard
5.0.0 - 7.3.0
Fixed in 7.3.1
Are you affected? Scan for Free

TL;DR

The security middleware resolves the matched route by walking the ASGI mount hierarchy with a hardcoded recursion depth cap. When a protected endpoint sits behind more nested mounts than the cap allows, route resolution gives up before reaching it and the per-route guard state is never populated. The downstream authentication handler treats the missing route configuration as nothing to enforce and lets the request through, so per-route authentication decorators are bypassed for deeply nested routes even though identical decorators enforce correctly at shallower depths. The fix replaces the fixed depth cap with a cycle-guarded traversal that reaches routes at any nesting depth.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you apply per-route authentication decorators to endpoints nested behind more ASGI mounts than the middleware's hardcoded depth cap.

Background info

fastapi-guard is vulnerable to Authentication Bypass in versions 5.0.0 - 7.3.0.

How to fix this

Upgrade the fastapi-guard library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform