Summary
A missing authentication flaw in the MiroFish REST API endpoint allows remote users to access application functionality without proper identity verification.
When the affected create_app function in backend/app/__init__.py is used with this misconfiguration, critical routes may be exposed to unauthenticated attackers over the network.
Affected context
The vulnerability arises in deployments of MiroFish (up to version 0.1.2) where the REST API is exposed over a network and the create_app function is responsible for wiring routes and middleware.
In this context, certain endpoints that should require authentication may be left accessible to any caller because the authentication layer is not correctly enforced or is missing entirely.
The risk is higher in environments where the API is reachable from untrusted networks or the public internet, and where sensitive operations are exposed via this REST interface.
Exploit preconditions
- Attack surface: Public or internal REST API endpoints provided by the MiroFish backend.
- Required access: Network access to the affected API; no prior authentication or valid credentials are required.
- Trigger point: Sending crafted HTTP requests directly to endpoints that should be protected but lack authentication checks.
- Why exploitation is possible: The
create_appfunction does not correctly apply authentication/authorization middleware or checks to all relevant routes, leading to endpoints being exposed without identity verification.
Why this happens
This issue is a classic example of CWE-287: Improper Authentication, and is closely related to CWE-306: Missing Authentication for Critical Function.
At the framework level, the application initialization logic in create_app fails to guarantee that authentication is consistently enforced for sensitive REST API routes.
This can manifest as routes being registered without authentication decorators, middleware not being applied globally, or configuration defaults that treat all users as anonymous.
The abstract pattern is that security controls are optional or opt-in at the route level instead of being enforced by default, which leads to unintended exposure when developers omit or misconfigure authentication for critical operations.
Potential impact
- An attacker may invoke sensitive REST API operations without logging in.
- Unauthenticated users could read, modify, or delete application data, depending on exposed endpoints.
- Critical administrative or configuration functions can be triggered by anyone with network access.
- The application's integrity and confidentiality may be compromised, potentially leading to broader system compromise through chained attacks.
General mitigation guidance
Effective mitigation focuses on enforcing authentication and authorization as default behaviors for REST APIs:
- Introduce a mandatory authentication layer (e.g., middleware) applied globally to all routes, with explicit allow-lists for truly public endpoints.
- Use a central access-control policy that maps routes to required authentication and roles, avoiding scattered ad-hoc checks in individual handlers.
- Design the
create_appfunction so that security configuration (authentication, authorization, CORS, rate limiting) is wired before any route registration. - Treat configuration flags that disable authentication as development-only, and ensure they are not enabled in production environments.
- Apply the principle of least privilege by ensuring that authenticated identities receive only the minimal access necessary to perform their tasks.
How teams detect issues like this
Detection typically involves both code and behavior analysis:
- Static review: Examine
create_appand routing modules to confirm that authentication middleware or decorators are applied to all non-public endpoints. - Static analysis rules: Use patterns that flag route registration functions lacking authentication/authorization annotations or middleware.
- Configuration audits: Check environment and framework configuration for flags that disable or bypass authentication checks.
- Dynamic testing: Perform authenticated vs. unauthenticated API calls during security testing to confirm that sensitive endpoints return authorization errors when called anonymously.
- Automated code review tools and API security scanners can be configured to identify routes that respond successfully to unauthenticated requests where protection is expected.

