Admin JWTs signed with a well-known secret when JWT_SECRET is unset #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity
High
What's going on
The admin API signs JWTs with
JWT_SECRETwhen set. If it is unset,NewJWTManagerused a fixed string compiled into the binary (dev-only-insecure-secret-change-in-prod).docker-compose.ymldoes not setJWT_SECRET, and the README docker path does not either.Anyone who can reach the admin API can mint a valid admin Bearer token without knowing the login password. That is full control of proxy hosts, streams, certs, and access lists.
Practical impact
A default
docker compose up(or a binary started with noJWT_SECRET) on a LAN/public bind has a publicly known signing key. Changing the admin password does not fix this.Fix
JWT_SECRETfrom the environment.data/.jwt_secret(mode 0600).A PR with this change is attached.