tinyauth Authorization Bypass via Case-Sensitive Hostname Matching
An authorization bypass vulnerability in tinyauth allows authenticated users to access restricted applications by manipulating the character casing of the request hostname, causing the service to fail open.
tinyauth is a forward-auth service that acts as a gatekeeper for reverse proxies like Traefik, Caddy, Nginx, and Envoy. It verifies authentication and enforces per-app access control lists (ACLs) based on hostnames. An authorization bypass exists in tinyauth versions prior to 5.1.2 due to case-sensitive string comparisons when matching incoming hostnames against configured ACLs.
Because DNS, HTTP routing, and TLS treat hostnames as case-insensitive, a reverse proxy will correctly route a mixed-case hostname (e.g., APP.example.com) to the intended application. However, when tinyauth receives this request, its lookup logic fails to match the hostname because it performs a case-sensitive comparison. When the lookup fails, the application incorrectly falls back to an empty configuration object instead of denying access. This "fail-open" behavior grants authorized status to any already-authenticated user, effectively ignoring any per-app users, groups, or ip allowlists. This vulnerability allows an attacker with a valid session to bypass intended access restrictions for any protected app on the same instance.
Attack Chain
- Attacker obtains a valid user session for the target tinyauth instance.
- Attacker identifies a target application protected by an ACL that explicitly excludes their user account or group.
- Attacker crafts an HTTP request for the target application using a mixed-case hostname (e.g.,
TargetApp.Example.Cominstead oftargetapp.example.com). - The reverse proxy receives the request, ignores the case difference, and routes it to the intended upstream backend.
- The proxy sends the request to tinyauth via the configured forward-auth endpoint, preserving the mixed-case hostname in the
X-Forwarded-HostorHostheader. - tinyauth's
GetAccessControlsfunction attempts to lookup the mixed-case hostname, fails to find a match due to case-sensitive logic, and returns an empty App configuration. - The authorization logic evaluates the empty configuration, defaults to "allow," and returns a
200 Authenticatedresponse to the reverse proxy. - The proxy forwards the request to the upstream application, treating the attacker as an authorized user.
Impact
Successful exploitation allows any authenticated user to bypass per-app access restrictions, gaining full access to the data and functionality of restricted applications. This defeats the product's primary security feature - the per-app trust boundary - within multi-app SSO deployments. Impacted sectors include any organization relying on tinyauth to manage granular access to internal services.
Recommendation
- Upgrade tinyauth to version 5.1.2 or later immediately to resolve the case-insensitive matching logic.
- Audit application access logs for unexpected
200 OKresponses from the forward-auth endpoint that correspond to known restricted users accessing sensitive subdomains. - Validate that your reverse proxy configuration and tinyauth instance are correctly synchronized regarding expected domain case-sensitivity.
Immediate actions
Upgrade tinyauth to 5.1.2
Threat Hunt
Analyze logs for high frequency of requests to the forward-auth endpoint containing mixed-case hostnames
Data: Web server access logs from the reverse proxy (Traefik/Nginx/Caddy)