fastapi-guard is vulnerable to Authentication Bypass
74
High Risk
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.
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.
fastapi-guard is vulnerable to Authentication Bypass in versions 5.0.0 - 7.3.0.
Upgrade the fastapi-guard library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.