Path traversal opening Sqlite3 database in WhoDB
Description
WhoDB is an open source database management tool. 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. Affected versions of WhoDB allow users to connect to Sqlite3 databases. By default, the databases must be present in /db/ (or alternatively ./tmp/ if development mode is enabled). If no databases are present in the default directory, the UI indicates that the user is unable to open any databases. 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. 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. 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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/clidey/whodb/coreGo | < 0.0.0-20250127172032-547336ac73c8 | 0.0.0-20250127172032-547336ac73c8 |
Affected products
1Patches
11 file changed · +8 −5
core/src/plugins/sqlite3/db.go+8 −5 modified@@ -2,19 +2,19 @@ package sqlite3 import ( "errors" - "os" - "path/filepath" - "github.com/clidey/whodb/core/src/engine" "github.com/clidey/whodb/core/src/env" "gorm.io/driver/sqlite" "gorm.io/gorm" + "os" + "path/filepath" + "strings" ) func getDefaultDirectory() string { - directory := "/db" + directory := "/db/" if env.IsDevelopment { - directory = "./tmp" + directory = "./tmp/" } return directory } @@ -24,6 +24,9 @@ var errDoesNotExist = errors.New("unauthorized or the database doesn't exist") func DB(config *engine.PluginConfig) (*gorm.DB, error) { database := config.Credentials.Database fileNameDatabase := filepath.Join(getDefaultDirectory(), database) + if !strings.HasPrefix(fileNameDatabase, getDefaultDirectory()) { + return nil, errDoesNotExist + } if _, err := os.Stat(fileNameDatabase); errors.Is(err, os.ErrNotExist) { return nil, errDoesNotExist }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-9r4c-jwx3-3j76ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-24786ghsaADVISORY
- github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.goghsax_refsource_MISCWEB
- github.com/clidey/whodb/blob/ba6eb81d0ca40baead74bca58b2567166999d6a6/core/src/plugins/sqlite3/db.goghsax_refsource_MISCWEB
- github.com/clidey/whodb/commit/547336ac73c8d17929c18c3941c0d5b0099753ccghsaWEB
- github.com/clidey/whodb/security/advisories/GHSA-9r4c-jwx3-3j76ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.