# WhoDB: Unauthenticated host file read through forged profile trust

Unauthenticated attacker forges IsProfile=true in legacy Bearer credentials, injecting allowAllFiles=true into the MySQL DSN so a rogue MySQL server exfiltrates host files via LOAD DATA LOCAL INFILE.

- Payout: Research
- Severity: high
- Program: WhoDB
- Found by: Xeraaaaaaa
- Disclosed: 2026-12-03
- CVE: CVE-2026-142651
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-2mwr-p8j5-rm33
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-2mwr-p8j5-rm33
- Tags: area:web domain:web impact:data-leak kind:research platform:ghsa sev:high tech:go tech:rest technique:incomplete-fix vuln:access-control vuln:auth-bypass vuln:misconfiguration vuln:path-traversal

**Target:** WhoDB legacy credential middleware and MySQL connection parser
**Root cause:** Legacy credential middleware decoded attacker JSON directly into Credentials including IsProfile, skipping server-side profile resolution; the shared GORM connection parser then copied unrecognized advanced options like allowAllFiles into the MySQL DSN.
**Steps:**
1. Send an unauthenticated request with a Bearer credential (or Token cookie) containing JSON with `IsProfile: true` and `allowAllFiles: true`.
2. Middleware decodes the JSON into Credentials; inline credentials skip profile resolution so the trust flag survives.
3. Point the connection at an attacker-controlled MySQL server reachable from the WhoDB host.
4. Rogue MySQL server issues `LOAD DATA LOCAL INFILE` for a chosen host file; driver returns its contents byte-for-byte.
**How found:** Bypass of the trust boundary introduced remediating CVE-2025-24787: noticed legacy credential middleware decoded client JSON straight into Credentials, so the client-controlled IsProfile trust flag survived inline-credential paths, then traced how the shared GORM parser copies unrecognized advanced options into the MySQL DSN.
**Exploitation:** Attacker needs network reach to WhoDB and a MySQL server reachable from the WhoDB host. Forged Bearer/cookie credential sets IsProfile=true and allowAllFiles=true, causing the driver to honor LOCAL INFILE requests; the malicious MySQL server requests arbitrary files readable by the WhoDB process and receives their contents, leaking config, env secrets, DB credentials and API keys.
**Insight:** When a fix adds a server-side trust flag (IsProfile) to gate dangerous connection options, check every legacy/inline credential path that deserializes client JSON into the same struct — the flag itself becomes attacker-controlled and re-enables options like allowAllFiles.

