fix(security): fail-open auth — set authenticated=False in dev mode#1572
fix(security): fail-open auth — set authenticated=False in dev mode#1572Joshua-Medvinsky wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the development-mode auth middleware to mark the synthesized dev user as unauthenticated and replaces the debug log with a warning.
Changes:
- Sets
authenticated: Falsefor the development user dictionary. - Replaces the debug log with a warning message about development mode.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "id": "sam_dev_user", | ||
| "name": "Sam Dev User", | ||
| "email": "sam@dev.local", | ||
| "authenticated": True, | ||
| "authenticated": False, | ||
| "auth_method": "development", |
| log.warning( | ||
| "AuthMiddleware: Development mode active — requests treated as unauthenticated. " | ||
| "Set frontend_use_authorization=true for production." | ||
| ) |
When frontend_use_authorization=false (default), the auth middleware previously set authenticated=True for all requests, making downstream auth checks trivially bypassed. This changes the dev-mode identity to authenticated=False and adds a startup warning. CWE-306: Missing Authentication for Critical Function Signed-off-by: Joshua Medvinsky <joshuam@ethlas.com> Signed-off-by: FailSafe Researcher <joshua@getfailsafe.com>
63fde6a to
d78d5c4
Compare
|
Hi maintainers 👋 This vulnerability was found by FailSafe — a top agentic cybersecurity company specializing in automated deep security analysis of AI/ML and agentic codebases. We're reporting these initial findings as a social good contribution to help secure the open-source AI ecosystem. If you'd like us to perform a deeper, more comprehensive security scan of your project, we'd love to hear from you — reach out at joshua@getfailsafe.com. Thanks for maintaining this project! 🙏 |
Summary
When frontend_use_authorization=false (default), the auth middleware sets authenticated=True for all requests, making downstream auth checks trivially bypassed. Any unauthenticated request is treated as the sam_dev_user with full authenticated privileges. This changes the dev-mode identity to authenticated=False and adds a startup warning.
Vulnerability
Severity: Critical
CWE: CWE-306 (Missing Authentication for Critical Function)
Location: src/solace_agent_mesh/shared/auth/middleware.py:299
The AuthMiddleware.call() checks frontend_use_authorization config. When False (default), it sets request.state.user to {"id": "sam_dev_user", "authenticated": True, "auth_method": "development"}. All downstream route handlers see authenticated=True and proceed without restriction.
An unauthenticated attacker can: list/create/delete sessions, send messages to agents (consuming LLM API credits), read/write artifacts, access admin config endpoints, and exfiltrate any data the agents have access to.
Fix
Change authenticated: True to authenticated: False in the dev-mode branch and add a log.warning(). Downstream code that checks authenticated will correctly reject unauthenticated requests. Dev mode still works for local testing but does not lie about authentication status.
Test Plan