[Security] Empty Admin Credentials Still Allow Forged Admin JWTs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Start at server/admin/src/server/middleware/auth.ts: read the key derivation (SECRET || "tailchat" plus md5 of adminAuth) and the JWT verify/platform check at lines 37-55, and compare with the login guard in server/admin/src/server/router/api.ts lines 31-35. The fix is to reject protected requests when ADMIN_PASS/SECRET are empty or default, and mirror it in server/admin-next/src/server/middleware/auth.ts (platform 'admin-next'). Done when the issue's proof-of-concept fetch to an admin endpoint returns 401 under the shipped docker-compose.env defaults, while a login with configured credentials still works.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Empty Admin Credentials Still Allow Forged Admin JWTs
Hello Tailchat maintainers, could you review a conditional authentication bypass in the optional admin service?
Summary
With the repository's docker-compose.env defaults, SECRET and ADMIN_PASS are empty and ADMIN_USER is tailchat. The admin signing key is therefore the publicly derivable value tailchat545497b05dba745043d8f287871bfa91. The login route rejects requests because the password is empty, but protected admin routes still accept a JWT signed with this key and containing platform: "admin".
Details
Reviewed revision: 89ab8bba033603415f46fc228b5771d99daa6a21.
auth.ts derives the signing key from SECRET || "tailchat" plus md5(JSON.stringify(adminAuth)). The shipped docker-compose.env sets SECRET=, ADMIN_USER=tailchat, and ADMIN_PASS=. These values produce the key above.
The inline comment says this MD5-derived suffix is intended to prevent token forgery when SECRET is unset and the admin credentials are changed. That protection relies on at least one credential being private. With the shipped defaults, both inputs are public; MD5 deterministically produces a public suffix and adds no secret entropy. This finding does not claim that every deployment with an unset SECRET is affected: deployments using non-public admin credentials derive a different key.
The login route refuses authentication when the admin password is empty (api.ts). However, the middleware only verifies the JWT and checks payload.platform === "admin"; it does not reject requests when admin credentials are unset (auth.ts). Protected endpoints include /callAction and user-management routes (api.ts). The admin service is optional and is exposed through the repository's docker/admin.yml.
The parallel admin-next middleware uses the same key derivation and accepts platform: "admin-next" (admin-next/auth.ts).
The admin service is optional and is not part of the base docker-compose.yml. Its deployment guide tells operators to set an independent ADMIN_PASS. Tailchat also documents that the default SECRET is public and must be replaced in production (environment documentation). Therefore, this finding applies when an operator enables the optional admin service but leaves both the shipped admin credentials and public fallback SECRET unchanged. The admin process does start in this configuration: startup validates MONGO_URL, not ADMIN_USER or ADMIN_PASS (index.ts). The login route is disabled, but protected API middleware still accepts the publicly forgeable admin JWT.
Proof of concept
For a deployment that enables the optional admin service and leaves the tracked docker-compose.env values unchanged, sign and send a token to a protected admin endpoint:
import jwt from 'jsonwebtoken';
import md5 from 'md5';
const authSecret =
'tailchat' +
md5(JSON.stringify({ username: 'tailchat', password: '' }));
const token = jwt.sign({ platform: 'admin' }, authSecret);
const response = await fetch(
'http://localhost:11000/admin/api/user/count/summary',
{ headers: { authorization: `Bearer ${token}` } },
);
console.log(response.status, await response.text());
The request is authorized without using the admin login route or knowing an admin password.
Impact
An unauthenticated network attacker who can reach an enabled admin service under these unchanged values can impersonate an administrator and access or modify data through protected admin APIs. This is a conditional default-key issue (CWE-1394: Use of Default Cryptographic Key). It requires enabling the optional admin service while ignoring the documented requirements to set an independent admin password and replace the public production SECRET; deployments following those instructions are not affected by this specific path.
Related Works
- EverShop — CVE-2023-46943 / GHSA-32r3-57hp-cgfw
- Peppermint — CVE-2023-42328 / GHSA-m4w4-j8c2-pv2w
- YourSpotify — CVE-2024-28194
- NocoBase — CVE-2025-13877 / GHSA-mv7p-34fv-4874
- FUXA — CVE-2026-25894 / GHSA-32cc-x95p-fxcg
- Claude Code UI — CVE-2026-31975 / GHSA-gv8f-wpm2-m5wr
- 9router — CVE-2026-49352 / GHSA-jphh-m39h-6gwx
- FastGPT — GHSA-w732-rq8c-chc8
This report is part of my ongoing security research. If you have any questions, please feel free to mention me. I would be glad to make even a small contribution to improving Tailchat's security.
- Lingua principale
- TypeScript
- Stelle
- 3.6k
- Fork
- 397
- Merge medio
- 2m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di msgbyte/tailchat
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 1/100
-
在某些地方用户名中的特殊符号并不能很好的显示 || Special symbols in user names are not displayed well in some placesAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di msgbyte/tailchat
Issue simili
-
First unknown-user login after boot is one scrypt run slower than a real user's wrong passwordApertaarea: backend bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
snapotter-hq/SnapOtter#2254 ·
I maintainer di solito rispondono entro 1 giorno
-
bug ticket
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cratestack/cratestack#1154 ·
I maintainer di solito rispondono entro 1 giorno
-
server 消息处理器 cmd 分支补显式错误回报——竞态非法命令现走未处理拒绝Forse già presa @openaddr l’ha presa oggi. Apertaready-for-agent refactor wayfinder:task
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openaddr/dafung-web#428 ·
I maintainer di solito rispondono entro 1 giorno
-
Flaky: mongodb-memory-server 'Port already in use' when another process starts a mongod concurrentlyApertaarea:testing bug effort:S priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
lens:agent lens:process process
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
thebristolsound/birdbrain#1772 ·
I maintainer di solito rispondono entro 1 giorno