Skip to content

[BUG] v5.0.3 breaks /api/auth/nginx for Kubernetes ingress-nginx users (Strict X-Forwarded-Uri requirement) #706

@Dual-0

Description

@Dual-0

Describe the bug
The recent security patches in v5.0.3 (GHSA-xg2q-62g2-cvcm / GHSA-3q28-qjrv-qr39) introduced strict enforcement of X-Forwarded-* headers, explicitly rejecting requests with empty or missing X-Forwarded-Uri headers. This completely breaks the /api/auth/nginx endpoint for Kubernetes users who are still one the NGINX Ingress Controller (ingress-nginx).

During an auth_request subrequest, NGINX natively sends X-Original-URI and X-Original-URL, not X-Forwarded-Uri. Because snippet annotations are disabled by default in modern ingress-nginx controllers for security reasons (CVE-2021-25742), users cannot use auth-snippet to manually inject the required X-Forwarded-Uri header, leaving them hard-blocked.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy Tinyauth v5.0.3 on a Kubernetes cluster using ingress-nginx.
  2. Protect an application using standard NGINX annotations (setting auth-url to http://<tinyauth>/api/auth/nginx).
  3. Attempt to access the protected application in a browser.
  4. See 400 Bad Request from the protected app.

Expected behavior
The /api/auth/nginx endpoint should either natively parse and accept NGINX's default X-Original-URI header, or not immediately reject the request when X-Forwarded-Uri is missing on this specific endpoint.

Logs

2026-03-11T19:26:32.015071502Z 2026-03-11T19:26:32Z ERR internal/controller/proxy_controller.go:339 > Header not found header=x-forwarded-uri log_stream=app
2026-03-11T19:26:32.015118142Z 2026-03-11T19:26:32Z WRN internal/middleware/zerolog_middleware.go:62 > Client Error address=10.0.132.34:50242 client_ip=2a01:599:c04:4d2a:b942:d76:62bb:8614 latency="194.082µs" log_stream=http method=GET path=/api/auth/nginx status=400
2026-03-11T19:26:33.545161041Z 2026-03-11T19:26:33Z ERR internal/controller/proxy_controller.go:339 > Header not found header=x-forwarded-uri log_stream=app

Device (please complete the following information):

  • OS: Kubernetes (Talos Linux)
  • Browser: Any
  • Tinyauth: v5.0.3
  • Docker: containerd

Additional context
The only workaround right now is to either downgrade to v5.0.2 or deploy a dedicated header-translation reverse proxy next to Tinyauth. Modifying the global ingress controller to allow-snippet-annotations: "true" is a severe security risk in multi-tenant clusters, so a native fix in Tinyauth's NGINX endpoint logic is needed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions