fastapi-azure-auth
Pass
Audited by Gen Agent Trust Hub on Apr 21, 2026
Risk Level: SAFECOMMAND_EXECUTIONCREDENTIALS_UNSAFEEXTERNAL_DOWNLOADS
Full Analysis
- [COMMAND_EXECUTION]: Potential SQL Injection surface detected in the database role lookup logic.
- Evidence: In
app/utils/auth.py, theget_user_rolefunction uses string interpolation within a SQL query template:SELECT role FROM dim.user_roles WHERE email = {email}. - Context: While the
sql(t"...")syntax implies a helper that may handle parameterization, theemailvariable can be directly influenced by theX-Test-Userrequest header whenTEST_MODEis enabled. - [CREDENTIALS_UNSAFE]: Use of an insecure default fallback for the session secret key.
- Evidence: In
app/auth/setup.py, theSessionMiddlewareis initialized with a hardcoded fallback:secret_key=os.getenv("API_COOKIE_SECRET", "change-me-in-production"). - [EXTERNAL_DOWNLOADS]: The skill facilitates authentication by connecting to Microsoft's well-known identity service.
- Evidence: The MSAL application is configured to communicate with
https://login.microsoftonline.com/for OAuth2 flows. - [COMMAND_EXECUTION]: Authentication bypass mechanisms for development and testing environments.
- Evidence: The
get_user_emailfunction inapp/utils/auth.pycontains logic to return a hardcoded email whenDEV_MODEis active or a header-supplied email whenTEST_MODEis active, effectively skipping the Entra ID verification.
Audit Metadata