You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Preserve WebUI credentials during backup restore and harden login token handling #263
Track two WebUI hardening issues reported through GitHub Security Advisory GHSA-w9h7-fgpw-3968:
The access token on the login endpoint is compared with a regular equality check and the endpoint has no login-attempt rate limit.
Restoring a backup can replace data/webui.json (including access_token) and data/.jwt_secret with values from the archive.
Steps to reproduce
For the login path, inspect webui/routes/auth.py: the submitted access token is compared using !=, and repeated failed requests to /api/auth/login are not throttled.
Create or obtain a backup containing webui.json and .jwt_secret, then restore it through the WebUI. The restore process copies these credential files into the active data directory.
Expected behavior
Compare access tokens in constant time, and add login-attempt protection that remains compatible with supported self-hosted and reverse-proxy deployments.
A backup restore must not silently replace the active access token or JWT signing secret.
Actual behavior
The comparison can short-circuit and unlimited failed login attempts are accepted.
A restored archive can change the running credentials, potentially causing an administrator lockout or adopting credentials present in the archive.
KiraAI version
v2.30.0 (1228ac2) and earlier, according to the original report.
Environment
Self-hosted WebUI; not specific to an operating system or Python version.
Logs / traceback
Not applicable; this was identified by static code review.
Activity