Skip to content

[Security] NoopAuthProvider grants wildcard permissions to all anonymous connections #1154

@Vi-shub

Description

@Vi-shub

🔍 Issue Description

In mofa-monitoring/src/dashboard/auth.rs, the default NoopAuthProvider grants wildcard * permissions to every connection with a hardcoded anonymous client ID:
https://github.com/mofa-org/mofa/blob/main/crates/mofa-monitoring/src/dashboard/auth.rs#L33-L38

async fn validate(&self, _token: &str) -> Result<AuthInfo, String> {
    Ok(AuthInfo {
        client_id: "anonymous".to_string(),
        permissions: vec!["*".to_string()], // ← full access for everyone
    })
}

📌 Issue Type

  • Bug
  • Feature Request
  • Enhancement
  • Documentation
  • Refactor
  • Security

📝 Description

Since NoopAuthProvider is the default auth provider (is_enabled() returns false), any monitoring dashboard deployment that doesn't explicitly configure a TokenAuthProvider will have zero authentication and give every client unrestricted access to all metrics, agent states, and WebSocket streams.

Impact
Any deployed monitoring dashboard is unauthenticated by default — agent execution data, metrics, and system internals are exposed
There is no warning log when NoopAuthProvider is active, making it easy to overlook in production
The permissions: vec!["*"] grants full wildcard access, so even if auth middleware checks permissions, anonymous clients pass every check


🎯 Proposed Solution (Optional but Encouraged)

When NoopAuthProvider is active, emit a tracing::warn!("Dashboard authentication is disabled — all connections are anonymous with full access") on first connection
Add a DashboardConfig flag require_auth: bool (default true) that panics at startup if no real auth provider is configured
Change default NoopAuthProvider permissions from "*" to "read:metrics" (read-only, no write/admin)
Add documentation warning in dashboard/mod.rs about securing production deployments


🙋 Claiming This Issue

To avoid duplicated work:

  • I'm willing to solve this issue by myself

🔔 Important

If you check the box above:

  1. Comment below: "I’d like to work on this."
  2. Wait for maintainer acknowledgment (if required).
  3. Then start working.

Metadata

Metadata

Assignees

Labels

area/platformInstallation, OS integration, environmentkind/bugSomething is brokenpriority/unknownCannot determine priorityrustPull requests that update rust codesecuritystatus/manual-triageRequires manual review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions