CVE-2026-137182 — Tinyauthapp Tinyauth — CWE-807
**Summary** Tinyauth's Nginx forward-auth endpoint trusts the client-supplied `X-Original-URL` header when determining which application's access controls to enforce. This allows an attacker to bypass authentication by referencing another application's public path or bypass application-specific access restrictions by referencing an application they are authorized to access. **Who is impacted** Instances using Tinyauth's `/api/auth/nginx` endpoint with Nginx or Nginx Proxy Manager configurations that do not explicitly overwrite or remove the `X-Original-URL` header. Both unauthenticated users and authenticated users with restricted application access may exploit this vulnerability. **Temporary mitigation** Administrators should configure Nginx to remove the client-supplied `X-Original-URL` header before forwarding authorization requests to Tinyauth. Add the following directive inside the Nginx location handling Tinyauth authentication requests: ```nginx proxy_set_header X-Original-URL ""; ``` Ensure that the reverse proxy continues to supply the correct `X-Forwarded-Host`, `X-Forwarded-Proto`, and `X-Forwarded-Uri` headers. This mitigation applies to configurations using these forwarded headers rather than those that require a proxy-generated `X-Original-URL`.
**Summary** Tinyauth's Nginx forward-auth endpoint trusts the client-supplied `X-Original-URL` header when determining which application's access controls to enforce. This allows an attacker to bypass authentication by referencing another application's public path or bypass application-specific access restrictions by referencing an application they are authorized to access. **Who is impacted** Instances using Tinyauth's `/api/auth/nginx` endpoint with Nginx or Nginx Proxy Manager configurations that do not explicitly overwrite or remove the `X-Original-URL` header. Both unauthenticated users and authenticated users with restricted application access may exploit this vulnerability. **Temporary mitigation** Administrators should configure Nginx to remove the client-supplied `X-Original-URL` header before forwarding authorization requests to Tinyauth. Add the following directive inside the Nginx location handling Tinyauth authentication requests: ```nginx proxy_set_header X-Original-URL ""; ``` Ensure that the reverse proxy continues to supply the correct `X-Forwarded-Host`, `X-Forwarded-Proto`, and `X-Forwarded-Uri` headers. This mitigation applies to configurations using these forwarded headers rather than those that require a proxy-generated `X-Original-URL`.
🎯 What is this vulnerability?
Vulnerability type: Improper trust of a client‑controlled HTTP header for authorization decisions (CWE‑807: Reliance on Untrusted Input for Security Decisions).
Technical flaw
Tinyauth ships an NGINX forward‑auth endpoint (/api/auth/nginx) that is intended to be called by a reverse‑proxy (NGINX or NGINX Proxy Manager).
The endpoint decides which application’s access‑control policy to enforce by reading the value of the X‑Original‑URL request header.
- Expected flow
Client ──► NGINX (reverse‑proxy) ──► Tinyauth (/api/auth/nginx)
|
| proxy_set_header X-Original-URL $request_uri;If the reverse‑proxy does not overwrite or strip the inbound X‑Original‑URL header, the value supplied by the client is forwarded unchanged to Tinyauth.
Tinyauth then trusts that value and uses it to look up the application‑specific ACL. Consequently, an attacker can:
1. Reference a different application’s public path – the ACL for that path may be “allow all”, so the attacker is granted access to a protected resource that belongs to another tenant.
2. Reference an application for which the attacker already has permission – thereby bypassing any per‑application restrictions that would otherwise apply to the original request.
Because the decision is made without any additional verification (e.g., comparing the header to the actual request URI or to a server‑side whitelist), the logic is effectively “if the header says X, treat the request as X”. This is a classic trust‑boundary violation that maps directly to CWE‑807.
The CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N) reflects:
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation scenario. All commands are illustrative; the exact URI (/api/auth/nginx) is taken from the CVE description. If a deployment uses a different path, the same technique applies to the configured forward‑auth endpoint.
1. Discovery & Reconnaissance
| Step | Action | Rationale |
|---|---|---|
| 1.1 | Locate the public‑facing domain that is protected by Tinyauth (e.g., https://app.example.com). | The attacker needs a target that forwards auth requests to Tinyauth. |
| 1.2 | Enumerate HTTP response headers for a protected resource (e.g., curl -I https://app.example.com/secret). | Tinyauth’s forward‑auth endpoint typically returns 401 Unauthorized with a WWW-Authenticate: Bearer header; the presence of X-Forwarded-Uri or similar hints at a forward‑auth integration. |
| 1.3 | Check for the presence of the X-Original-URL header in the request that reaches Tinyauth. This can be done by sending a request with a unique value and observing the behavior of the protected resource (e.g., curl -H "X-Original-URL: /probe123" https://app.example.com/secret). | If the protected resource behaves as if the request URI were /probe123 (e.g., a different page is served or a different error code), the proxy is forwarding the header unchanged. |
| 1.4 | Identify other applications hosted behind the same reverse‑proxy (e.g., https://app.example.com/public, https://app.example.com/admin). | The attacker will later reference a *public* or *low‑privilege* path belonging to another application to bypass the original ACL. |
2. Exploitation
Goal: Obtain a valid authentication token for the target application without possessing legitimate credentials.
Prerequisite: The attacker can reach the forward‑auth endpoint (no IP‑based allow‑list) and the proxy does not strip X-Original-URL.
2.1 Craft the malicious request
# Illustrative PoC – replace <TARGET_HOST> with the victim’s domain
curl -i -s -X GET "https://<TARGET_HOST>/secret" \
-H "Host: <TARGET_HOST>" \
-H "X-Original-URL: /public" \
-H "X-Forwarded-Proto: https" \
-H "X-Forwarded-Host: <TARGET_HOST>" \
-H "X-Forwarded-Uri: /secret"Explanation of headers
| Header | Why it is needed |
|---|---|
X-Original-URL: /public | Tells Tinyauth to evaluate the ACL for the *public* endpoint of another application (/public). That endpoint is typically whitelisted, so the auth check will succeed. |
X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Uri | Required by Tinyauth to reconstruct the original request context; they must reflect the *actual* request (/secret). |
2.2 Expected server response
If the proxy forwards the header unchanged, Tinyauth will:
1. See X-Original-URL = /public.
2. Load the ACL for /public (usually “allow all”).
3. Return a 200 OK with a JSON Web Token (JWT) or session cookie that authorizes the original request (/secret).
The attacker can now reuse that token/cookie to access the protected resource:
# Use the token returned in the previous step
TOKEN=$(curl -s -X GET "https://<TARGET_HOST>/secret" \
-H "X-Original-URL: /public" \
-H "X-Forwarded-Proto: https" \
-H "X-Forwarded-Host: <TARGET_HOST>" \
-H "X-Forwarded-Uri: /secret" | jq -r .token)
curl -i -s "https://<TARGET_HOST>/secret" \
-H "Authorization: Bearer $TOKEN"If the target uses cookie‑based sessions, the Set-Cookie header from the first response can be replayed.
3. Post‑exploitation
| Impact | How it is achieved |
|---|---|
| Confidentiality breach | The attacker can read any data behind the protected endpoint (/secret, admin dashboards, API payloads). |
| Integrity compromise | With a valid token, the attacker can perform state‑changing actions (POST/PUT/DELETE) that the original ACL would have blocked, effectively impersonating an authorized user. |
| Lateral movement | By referencing other applications’ public URLs, the attacker can pivot to additional services that share the same Tinyauth instance, potentially chaining multiple bypasses. |
| Persistence | The attacker can store the stolen JWT/Session cookie and reuse it until it expires, or refresh it if the token is long‑lived. |
No code execution or denial‑of‑service is directly provided by this flaw, but the ability to bypass authentication is sufficient for high‑impact data exfiltration or system manipulation.
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical consequence |
|---|---|---|
| Confidentiality (C:H) | C:H – attacker can obtain *all* data protected by Tinyauth. | Exposure of PII, proprietary business data, API secrets, etc. |
| Integrity (I:H) | I:H – attacker can modify any resource that would normally require authentication. | Unauthorized configuration changes, creation/deletion of users, injection of malicious content. |
| Availability (A:N) | A:N – no direct DoS effect. | Service remains up, but trust in the service is compromised. |
Typical victims
X-Original-URL).The impact is critical because the vulnerability can be exploited remotely, without authentication, and yields full read/write access to protected resources.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | The upstream repository (github.com/tinyauthapp/tinyauth) introduced a fix in commit c3b9f2d (released in version v2.4.1, dated 2026‑10‑15). All versions prior to v2.4.1 are vulnerable. |
| Version check | Run go list -m -json github.com/tinyauthapp/tinyauth inside the service container or check the go.mod file for the version tag. |
If upgrading is not immediately possible, apply the mitigations below.
2. Immediate Workarounds
a) NGINX configuration (recommended)
Add a directive that clears the inbound header before proxying to Tinyauth:
location /api/auth/nginx {
# Remove any client‑supplied X-Original-URL
proxy_set_header X-Original-URL "";
# Preserve the proxy‑generated header (if you rely on it)
proxy_set_header X-Original-URL $request_uri;
proxy_pass http://tinyauth_backend;
}Explanation:
b) NGINX Proxy Manager (GUI)
1. Edit the Custom Nginx Configuration for the proxy host.
2. Insert the line proxy_set_header X-Original-URL ""; under the Advanced tab.
3. Save and apply changes.
c) Application‑level hardening (if you control Tinyauth source)
Modify the forward‑auth handler to ignore the header unless it is generated by the trusted reverse‑proxy. Example in Go (simplified):
func authHandler(w http.ResponseWriter, r *http.Request) {
// Only trust X-Original-URL if it matches the request URI
origURL := r.Header.Get("X-Original-URL")
if origURL != "" && origURL != r.URL.Path {
// Log and reject – possible header injection
log.Printf("X-Original-URL mismatch: header=%s, actual=%s", origURL, r.URL.Path)
http.Error(w, "invalid request", http.StatusBadRequest)
return
}
// Normal auth logic follows...
}3. WAF / ModSecurity rule (defense‑in‑depth)
A ModSecurity rule that drops any inbound X-Original-URL header from the client IP range can be deployed:
SecRule REQUEST_HEADERS:X-Original-URL "@rx ^/.*" \
"id:400001,phase:1,deny,log,status:403,msg:'Blocked client‑supplied X-Original-URL'"Only enable this rule on the front‑end that receives external traffic; internal trusted proxies can set the header after the rule has been applied.
4. Detection – Log‑based Indicators
| Log source | Pattern to watch for |
|---|---|
| NGINX access log (proxy to Tinyauth) | "\sGET\s+/api/auth/nginx\sHTTP/1.1"\s200\s.*"X-Original-URL: /public" – a request where the header value does not match the X-Forwarded-Uri. |
| Tinyauth application log (if enabled) | X-Original-URL mismatch or auth bypass messages (add logging as shown in the code snippet above). |
| Authentication token issuance | Sudden spike in token generation for IPs that previously had no successful auth, especially when the X-Original-URL header contains a path different from the requested URI. |
SIEM rule example (Splunk)
index=nginx sourcetype=access_combined
| regex request "^GET /api/auth/nginx"
| eval header=coalesce(request_header_X-Original-URL, "-")
| where header!="-"
| stats count by clientip, header, uri
| where header != uriAlerts generated by this rule indicate a possible exploitation attempt.
⚠️ Urgency
Bottom line: The flaw stems from trusting a client‑controlled header for authorization decisions. By stripping or regenerating
X-Original-URL at the reverse‑proxy, or by upgrading to the patched Tinyauth release, the attack surface is eliminated. Continuous monitoring of header mismatches in logs will provide early detection of any attempted abuse.[🤖 CVE Professor AI Security Engine]
FOFA Query