Summary
Under proxy authentication with a non-default auth.logoutPage, File Browser waives the JWT expiration inside its shared authentication middleware. An expired but validly signed token therefore keeps authenticating every protected route, administrative ones included, and can be exchanged for a fresh token at /api/renew, so a token stolen before it expired stays usable indefinitely. Reported against v2.63.2; introduced in v2.50.0 and verified through v2.63.21.
Details
In http/auth.go, renewableErr treats jwt.ErrTokenExpired as renewable whenever the auth method is proxy and the logout page is non-default, and withUser consults it on every request instead of only on a renewal path:
token, err := request.ParseFromRequest(r, &extractor{}, keyFunc, request.WithClaims(&tk), request.WithParser(p))
if (err != nil || !token.Valid) && !renewableErr(err, d) {
return http.StatusUnauthorized, nil
}
The middleware then loads the user named by the expired claims and continues. withAdmin is layered on withUser, so administrative routes inherit the behavior, and renewHandler — also built on withUser — hands out a new token.
Waiving the expiration is intentional: under proxy authentication the trusted proxy, not the token, owns the session lifetime (see #3884, which for the same reason disables the frontend idle timer in this configuration). The defect is that the waiver was granted on the strength of the token alone, without checking that the proxy still asserts that identity.
PoC
Preconditions:
- File Browser uses proxy authentication.
auth.logoutPage is configured to a non-default value.
- The attacker holds a previously valid signed token. Its permissions bound the impact.
- Neither JWT forgery nor a bypass of the trusted proxy is required.
Steps:
- Start an instance with proxy authentication, a non-default logout page, and
tokenExpirationTime=1s for an accelerated test.
- Log in through the trusted proxy header as an administrator test account and keep the issued token.
- Wait for the configured token lifetime to elapse.
- Request a protected raw file with
X-Auth: <expired token>. It returns 200 with the protected content and X-Renew-Token: true.
- Request
/api/settings with the same expired token. It returns 200.
- Request
/api/renew with the same expired token. It returns 200 and a new token.
Impact
In the affected configuration, JWT expiration cannot end a session. A token captured before it expired continues to read protected data with the permissions it carries — administrative settings when it belongs to an administrator — and can be refreshed indefinitely.
Patches
Fixed in v2.63.22. The expiration is now waived only when the configured proxy header still names the user the token was issued for, which the trusted proxy asserts on any genuine request; an expired token presented on its own, or alongside a different identity, is rejected with 401.
Workarounds
Leave auth.logoutPage at its default value, which disables the waiver entirely and restores ordinary token expiration.
References
Summary
Under proxy authentication with a non-default
auth.logoutPage, File Browser waives the JWT expiration inside its shared authentication middleware. An expired but validly signed token therefore keeps authenticating every protected route, administrative ones included, and can be exchanged for a fresh token at/api/renew, so a token stolen before it expired stays usable indefinitely. Reported against v2.63.2; introduced in v2.50.0 and verified through v2.63.21.Details
In
http/auth.go,renewableErrtreatsjwt.ErrTokenExpiredas renewable whenever the auth method is proxy and the logout page is non-default, andwithUserconsults it on every request instead of only on a renewal path:The middleware then loads the user named by the expired claims and continues.
withAdminis layered onwithUser, so administrative routes inherit the behavior, andrenewHandler— also built onwithUser— hands out a new token.Waiving the expiration is intentional: under proxy authentication the trusted proxy, not the token, owns the session lifetime (see #3884, which for the same reason disables the frontend idle timer in this configuration). The defect is that the waiver was granted on the strength of the token alone, without checking that the proxy still asserts that identity.
PoC
Preconditions:
auth.logoutPageis configured to a non-default value.Steps:
tokenExpirationTime=1sfor an accelerated test.X-Auth: <expired token>. It returns200with the protected content andX-Renew-Token: true./api/settingswith the same expired token. It returns200./api/renewwith the same expired token. It returns200and a new token.Impact
In the affected configuration, JWT expiration cannot end a session. A token captured before it expired continues to read protected data with the permissions it carries — administrative settings when it belongs to an administrator — and can be refreshed indefinitely.
Patches
Fixed in v2.63.22. The expiration is now waived only when the configured proxy header still names the user the token was issued for, which the trusted proxy asserts on any genuine request; an expired token presented on its own, or alongside a different identity, is rejected with
401.Workarounds
Leave
auth.logoutPageat its default value, which disables the waiver entirely and restores ordinary token expiration.References