{"id":"CVE-2025-24787","aliases":["CVE-2025-24787","GHSA-c7w4-9wv8-7x7c","GO-2025-3457"],"related":[],"kind":"vulnerability","state":"published","title":"Parameter injection in DB connection URIs leading to local file inclusion in WhoDB","summary":"WhoDB is an open source database management tool. In affected versions the application is vulnerable to parameter injection in database connection strings, which allows an attacker to read local files on the machine the application is running on. The application uses string concatenation to build database connection URIs which are then passed to corresponding libraries responsible for setting up the database connections. This string concatenation is done unsafely and without escaping or encoding the user input. This allows an user, in many cases, to inject arbitrary parameters into the URI string. These parameters can be potentially dangerous depending on the libraries used. One of these dangerous parameters is `allowAllFiles` in the library `github.com/go-sql-driver/mysql`. Should this be set to `true`, the library enables running the `LOAD DATA LOCAL INFILE` query on any file on the host machine (in this case, the machine that WhoDB is running on). By injecting `&allowAllFiles=true` into the connection URI and connecting to any MySQL server (such as an attacker-controlled one), the attacker is able to read local files. This issue has been addressed in version 0.45.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"WhoDB is an open source database management tool. In affected versions the application is vulnerable to parameter injection in database connection strings, which allows an attacker to read local files on the machine the application is running on. The application uses string concatenation to build database connection URIs which are then passed to corresponding libraries responsible for setting up the database connections. This string concatenation is done unsafely and without escaping or encoding the user input. This allows an user, in many cases, to inject arbitrary parameters into the URI string. These parameters can be potentially dangerous depending on the libraries used. One of these dangerous parameters is `allowAllFiles` in the library `github.com/go-sql-driver/mysql`. Should this be set to `true`, the library enables running the `LOAD DATA LOCAL INFILE` query on any file on the host machine (in this case, the machine that WhoDB is running on). By injecting `&allowAllFiles=true` into the connection URI and connecting to any MySQL server (such as an attacker-controlled one), the attacker is able to read local files. This issue has been addressed in version 0.45.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe application is vulnerable to parameter injection in database connection strings, which allows an attacker to read local files on the machine the application is running on.\n\n### Details\n\nThe application uses string concatenation to build database connection URIs which are then passed to corresponding libraries responsible for setting up the database connections.\n\nThis string concatenation is done unsafely and without escaping or encoding the user input. This allows an user, in many cases, to inject arbitrary parameters into the URI string. These parameters can be potentially dangerous depending on the libraries used.\n\nOne of these dangerous parameters is `allowAllFiles` in the library `github.com/go-sql-driver/mysql`. Should this be set to `true`, the library enables running the `LOAD DATA LOCAL INFILE` query on any file on the host machine (in this case, the machine that WhoDB is running on). Source: https://github.com/go-sql-driver/mysql/blob/7403860363ca112af503b4612568c3096fecb466/infile.go#L128\n\nBy injecting `&allowAllFiles=true` into the connection URI and connecting to any MySQL server (such as an attacker-controlled one), the attacker is able to read local files.\n\n### PoC\n\nAs this vulnerability does not require sending requests manually and can all be done using the WhoDB UI, screenshots are provided instead of HTTP requests.\n\nFor this proof-of-concept, a clean instance of WhoDB and MySQL were set up using podman (docker is a suitable alternative):\n\n```\npodman network create whodb-poc\npodman run -d -p 8080:8080 --network whodb-poc docker.io/clidey/whodb\npodman run -d --name mysql -e MYSQL_ROOT_PASSWORD=password --network whodb-poc docker.io/mysql:9\n```\n\nThe attacker connects to the database via WhoDB. Note that in the `Loc` field, the string `&allowAllFiles=true` is inserted:\n\n![2025-01-21-13-28-08](https://github.com/user-attachments/assets/28709707-97e4-4d26-b61c-5462db6dd43f)\n\nAfter connecting, the attacker navigates to the scratchpad in `/scratchpad`.\n\nThe attacker first creates a demo table:\n```sql\nCREATE TABLE poc (\n    line TEXT\n);\n```\n\nThe attacker then enables loading files from the server side. For the sake of clarity, do note that while this is required, the file is not being read from the remote server where MySQL is running, but the local machine that WhoDB is running on.\n```sql\nSET GLOBAL local_infile=1;\n```\n\nThe attacker then uses the `LOAD DATA LOCAL INFILE` statement to read the contents of `/etc/passwd` (in this case from inside the container where WhoDB is running) into the previously created table:\n```sql\nLOAD DATA LOCAL INFILE '/etc/passwd'\nINTO TABLE poc\nFIELDS TERMINATED BY '\\0'\nLINES TERMINATED BY '\\n';\n```\n\nThe attacker then navigates to the `poc` table in the _Tables_ view and observes that the file has been read successfully:\n\n![2025-01-21-14-04-47](https://github.com/user-attachments/assets/c8f499ce-0d40-49ba-a2c6-fe2d12c677c5)\n\n### Impact\n\nWhile this proof-of-concept demonstrates local file inclusion, the root cause of the issue is the unsafe construction of database connection URIs from user input. Not all database connector libraries used in WhoDB were inspected; there may be libraries which allow for even more impactful parameters.\n\nThe attack requires no user authentication to WhoDB (only authentication to any database server, such as an attacker-controlled one) and no special configuration - the default configuration of the application is vulnerable.","format":"markdown","source":"ghsa"},{"lang":"en","text":"WhoDB allows parameter injection in DB connection URIs leading to local file inclusion in github.com/clidey/whodb/core","format":"markdown","source":"go"},{"lang":"es","text":"WhoDB es una herramienta de gestión de bases de datos de código abierto. En las versiones afectadas, la aplicación es vulnerable a la inyección de parámetros en las cadenas de conexión de la base de datos, lo que permite a un atacante leer archivos locales en la máquina en la que se ejecuta la aplicación. La aplicación utiliza la concatenación de cadenas para crear las URI de conexión a la base de datos que luego se pasan a las librerías correspondientes responsables de configurar las conexiones a la base de datos. Esta concatenación de cadenas se realiza de forma insegura y sin escapar ni codificar la entrada del usuario. Esto permite a un usuario, en muchos casos, inyectar parámetros arbitrarios en la cadena URI. Estos parámetros pueden ser potencialmente peligrosos según las librerías utilizadas. Uno de estos parámetros peligrosos es `allowAllFiles` en la librería `github.com/go-sql-driver/mysql`. Si se establece en `true`, la librería permite ejecutar la consulta `LOAD DATA LOCAL INFILE` en cualquier archivo en la máquina host (en este caso, la máquina en la que se ejecuta WhoDB). Al inyectar `&amp;allowAllFiles=true` en la URI de conexión y conectarse a cualquier servidor MySQL (como uno controlado por el atacante), el atacante puede leer archivos locales. Este problema se ha solucionado en la versión 0.45.0 y se recomienda a todos los usuarios que actualicen la versión. No se conocen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2025-02-06T18:41:17.518Z","modified":"2026-06-17T08:59:36.530Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-943"],"affected":[{"ranges":[{"version":"< 0.45.0","status":"affected"}],"vendor":"clidey","product":"whodb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20250127202645-8d67b767e005"}],"ecosystem":"Go","package":"github.com/clidey/whodb/core","purl":"pkg:golang/github.com/clidey/whodb/core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20250127202645-8d67b767e005"}],"ecosystem":"Go","package":"github.com/clidey/whodb/core","purl":"pkg:golang/github.com/clidey/whodb/core","source":"go"},{"ranges":[{"status":"affected","fixed":"0.45.0"}],"vendor":"clidey","product":"whodb","cpe":"cpe:2.3:a:clidey:whodb:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/clidey/whodb/security/advisories/GHSA-c7w4-9wv8-7x7c","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-sql-driver/mysql/blob/7403860363ca112af503b4612568c3096fecb466/infile.go#L128","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24787","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/clidey/whodb/commit/8d67b767e00552e5eba2b1537179b74bfa662ee1","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/clidey/whodb","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-02-06T19:24:35.198Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-24787","url":"https://www.cve.org/CVERecord?id=CVE-2025-24787","licence":"CVE Terms of Use","modified":"2025-02-06T19:25:09.541Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c7w4-9wv8-7x7c","url":"https://github.com/advisories/GHSA-c7w4-9wv8-7x7c","licence":"CC-BY-4.0","modified":"2025-02-07T23:11:44.871Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3457","url":"https://pkg.go.dev/vuln/GO-2025-3457","licence":"CC-BY-4.0","modified":"2026-03-03T04:56:15.520Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-24787","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24787","licence":"Public domain","modified":"2026-06-17T08:59:36.530Z"}],"updatedAt":"2026-11-25T22:58:53.884Z","epss":{"score":0.00765,"percentile":0.51838,"date":"2026-11-30T12:00:22.000Z"}}