{"id":"CVE-2026-55500","aliases":["EUVD-2026-42928","GHSA-qvfm-67h2-2qfx"],"status":"published","title":"9router: Exposure of Sensitive Information and Unprotected Database Import/Export Allows Complete Credential Theft and Database Takeover","description":"9Router is an AI router \u0026 token saver. Prior to 0.4.80, the /api/settings/database endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the ALWAYS_PROTECTED middleware check, which only validates JWT or CLI token. This issue is fixed in version 0.4.80.","severity":{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.0048,"percentile":0.41869,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-200"],"published":"2026-07-06T21:37:49Z","modified":"2026-11-11T02:49:03Z","affected":[{"source":"ghsa","ecosystem":"npm","package":"9router","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.4.71"}]}]},{"source":"osv","ecosystem":"npm","package":"9router","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.4.71"}]}]}],"products":[{"vendor":"decolua","product":"9router"}],"references":[{"url":"https://github.com/decolua/9router/security/advisories/GHSA-qvfm-67h2-2qfx","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/decolua/9router/commit/0c7c9de00ae3ab81d6580e3cc368483c4c03f6fd","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/decolua/9router/releases/tag/v0.4.80","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/advisories/GHSA-qvfm-67h2-2qfx"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55500.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55500","tags":["advisory"]},{"url":"https://github.com/decolua/9router","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-55500","title":"9router: Exposure of Sensitive Information and Unprotected Database Import/Export Allows Complete Credential Theft and Database Takeover","description":"9Router is an AI router \u0026 token saver. Prior to 0.4.80, the /api/settings/database endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the ALWAYS_PROTECTED middleware check, which only validates JWT or CLI token. This issue is fixed in version 0.4.80.","status":"published","published":"2026-07-10T15:28:27.62Z","modified":"2026-07-10T15:41:31.178Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:20:12.260247Z"}],"euvd":[{"id":"EUVD-2026-42928","description":"9Router is an AI router \u0026 token saver. Prior to 0.4.80, the /api/settings/database endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the ALWAYS_PROTECTED middleware check, which only validates JWT or CLI token. This issue is fixed in version 0.4.80.","status":"published","published":"2026-07-10T15:28:27Z","modified":"2026-07-10T15:41:31Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T18:20:02.822464Z"}],"ghsa":[{"id":"GHSA-qvfm-67h2-2qfx","title":"9routers has Exposure of Sensitive Information and Unprotected Database Import/Export, Allowing Complete Credential Theft and Database Takeover","description":"## Summary\n\nThe `/api/settings/database` endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the `ALWAYS_PROTECTED` middleware check, which only validates JWT or CLI token. Combined with other vulnerabilities (e.g., default password, tunnel exposure), this enables complete database takeover.\n\n## Description\n\nThe endpoint `/api/settings/database` is listed in `ALWAYS_PROTECTED` in `dashboardGuard.js` (line 42), which requires a valid JWT token or CLI token. However, this protection is insufficient because:\n\n1. **GET (Export):** Returns the complete database including API keys (`key` field in `apiKeys` table), OAuth tokens, and all provider credentials. Line 80 in `src/lib/db/index.js`: `apiKeys: db.all(\"SELECT * FROM apiKeys\").map(...)` — the `key` field contains the plaintext API key value.\n\n2. **POST (Import):** Accepts arbitrary JSON and performs a complete database wipe-and-replace in a transaction (lines 102-163 in `src/lib/db/index.js`). This replaces all settings including the password hash, effectively allowing an attacker to set their own password.\n\n3. The exported data includes `apiKeys` with their plaintext `key` values, `providerConnections` with all OAuth tokens, and `settings` with OIDC client secrets.\n\n### Evidence\n\n**File:** `src/app/api/settings/database/route.js`\n```javascript\nexport async function GET() {\n  const payload = await exportDb();\n  return NextResponse.json(payload);\n}\n\nexport async function POST(request) {\n  const payload = await request.json();\n  await importDb(payload);\n  // ...\n}\n```\n\n**File:** `src/lib/db/index.js` (lines 96-163)\n```javascript\nexport async function importDb(payload) {\n  db.transaction(() =\u003e {\n    // Wipe all tables\n    db.run(`DELETE FROM settings`);\n    db.run(`DELETE FROM providerConnections`);\n    db.run(`DELETE FROM providerNodes`);\n    db.run(`DELETE FROM proxyPools`);\n    db.run(`DELETE FROM apiKeys`);\n    db.run(`DELETE FROM combos`);\n    db.run(`DELETE FROM kv WHERE scope IN (...)`);\n    // Then insert attacker-controlled data\n    // ...\n  });\n}\n```\n\nThe `exportDb` function at line 80 exposes API key plaintext:\n```javascript\napiKeys: db.all(`SELECT * FROM apiKeys`).map((r) =\u003e ({ \n  id: r.id, key: r.key, name: r.name, ...\n})),\n```\n\n## Steps to Reproduce\n\n1. Authenticate with any valid JWT (e.g., using the default password \"123456\")\n2. Export: `curl -b auth_token=\u003cjwt\u003e http://localhost:20128/api/settings/database`\n3. Observe: Full database dump with all credentials in plaintext\n4. Import malicious data: `curl -X POST -b auth_token=\u003cjwt\u003e -H \"Content-Type: application/json\" -d '\u003cmodified-db\u003e' http://localhost:20128/api/settings/database`\n5. All settings, passwords, API keys are now replaced with attacker-controlled values\n\n## Impact\n\n- **Confidentiality:** Complete exposure of all stored secrets (API keys, OAuth tokens, OIDC client secrets)\n- **Integrity:** Complete database replacement with attacker-controlled data\n- **Availability:** Database wipe is possible by importing an empty database\n- **Scope Changed:** Importing new settings affects all users and downstream services\n\n## Recommended Fix\n\n1. Require re-authentication for database export/import (not just an existing session)\n2. Mask/redact API keys in export (or require explicit opt-in for key export)\n3. Add confirmation step for import (require current password verification)\n4. Implement database backup before import\n5. Log all export/import operations with audit trail","status":"published","published":"2026-07-06T21:37:49Z","modified":"2026-07-06T21:37:49Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:40:39.314643Z"}],"nvd":[{"id":"CVE-2026-55500","description":"9Router is an AI router \u0026 token saver. Prior to 0.4.80, the /api/settings/database endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the ALWAYS_PROTECTED middleware check, which only validates JWT or CLI token. This issue is fixed in version 0.4.80.","status":"published","published":"2026-07-10T16:16:33.357Z","modified":"2026-10-25T15:10:00.147Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:12:28.771746Z"}],"osv":[{"id":"CVE-2026-55500","title":"9router: Exposure of Sensitive Information and Unprotected Database Import/Export Allows Complete Credential Theft and Database Takeover","description":"9Router is an AI router \u0026 token saver. Prior to 0.4.80, the /api/settings/database endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the ALWAYS_PROTECTED middleware check, which only validates JWT or CLI token. This issue is fixed in version 0.4.80.","status":"published","published":"2026-07-10T15:28:27.62Z","modified":"2026-11-11T10:47:34.972797258Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-200"],"updated_at":"2026-11-11T03:21:28.618498Z"},{"id":"GHSA-qvfm-67h2-2qfx","title":"9routers has Exposure of Sensitive Information and Unprotected Database Import/Export, Allowing Complete Credential Theft and Database Takeover","description":"## Summary\n\nThe `/api/settings/database` endpoint allows full database export (containing all credentials, API keys, OAuth tokens, and settings) and full database import (complete overwrite) without any authentication requirement beyond the `ALWAYS_PROTECTED` middleware check, which only validates JWT or CLI token. Combined with other vulnerabilities (e.g., default password, tunnel exposure), this enables complete database takeover.\n\n## Description\n\nThe endpoint `/api/settings/database` is listed in `ALWAYS_PROTECTED` in `dashboardGuard.js` (line 42), which requires a valid JWT token or CLI token. However, this protection is insufficient because:\n\n1. **GET (Export):** Returns the complete database including API keys (`key` field in `apiKeys` table), OAuth tokens, and all provider credentials. Line 80 in `src/lib/db/index.js`: `apiKeys: db.all(\"SELECT * FROM apiKeys\").map(...)` — the `key` field contains the plaintext API key value.\n\n2. **POST (Import):** Accepts arbitrary JSON and performs a complete database wipe-and-replace in a transaction (lines 102-163 in `src/lib/db/index.js`). This replaces all settings including the password hash, effectively allowing an attacker to set their own password.\n\n3. The exported data includes `apiKeys` with their plaintext `key` values, `providerConnections` with all OAuth tokens, and `settings` with OIDC client secrets.\n\n### Evidence\n\n**File:** `src/app/api/settings/database/route.js`\n```javascript\nexport async function GET() {\n  const payload = await exportDb();\n  return NextResponse.json(payload);\n}\n\nexport async function POST(request) {\n  const payload = await request.json();\n  await importDb(payload);\n  // ...\n}\n```\n\n**File:** `src/lib/db/index.js` (lines 96-163)\n```javascript\nexport async function importDb(payload) {\n  db.transaction(() =\u003e {\n    // Wipe all tables\n    db.run(`DELETE FROM settings`);\n    db.run(`DELETE FROM providerConnections`);\n    db.run(`DELETE FROM providerNodes`);\n    db.run(`DELETE FROM proxyPools`);\n    db.run(`DELETE FROM apiKeys`);\n    db.run(`DELETE FROM combos`);\n    db.run(`DELETE FROM kv WHERE scope IN (...)`);\n    // Then insert attacker-controlled data\n    // ...\n  });\n}\n```\n\nThe `exportDb` function at line 80 exposes API key plaintext:\n```javascript\napiKeys: db.all(`SELECT * FROM apiKeys`).map((r) =\u003e ({ \n  id: r.id, key: r.key, name: r.name, ...\n})),\n```\n\n## Steps to Reproduce\n\n1. Authenticate with any valid JWT (e.g., using the default password \"123456\")\n2. Export: `curl -b auth_token=\u003cjwt\u003e http://localhost:20128/api/settings/database`\n3. Observe: Full database dump with all credentials in plaintext\n4. Import malicious data: `curl -X POST -b auth_token=\u003cjwt\u003e -H \"Content-Type: application/json\" -d '\u003cmodified-db\u003e' http://localhost:20128/api/settings/database`\n5. All settings, passwords, API keys are now replaced with attacker-controlled values\n\n## Impact\n\n- **Confidentiality:** Complete exposure of all stored secrets (API keys, OAuth tokens, OIDC client secrets)\n- **Integrity:** Complete database replacement with attacker-controlled data\n- **Availability:** Database wipe is possible by importing an empty database\n- **Scope Changed:** Importing new settings affects all users and downstream services\n\n## Recommended Fix\n\n1. Require re-authentication for database export/import (not just an existing session)\n2. Mask/redact API keys in export (or require explicit opt-in for key export)\n3. Add confirmation step for import (require current password verification)\n4. Implement database backup before import\n5. Log all export/import operations with audit trail","status":"published","published":"2026-07-06T21:37:49Z","modified":"2026-07-06T21:56:32.487399Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T15:46:55.122811Z"}]}}
