CVE-2026-22820 Overview
CVE-2026-22820 is a Time-of-Check Time-of-Use (TOCTOU) race condition vulnerability in Outray, an open-source ngrok alternative for creating secure tunnels. Prior to version 0.1.5, the application fails to properly synchronize access to subscription plan tunnel limits, allowing attackers to exploit a race condition to exceed their allocated number of active tunnels.
Critical Impact
Attackers can bypass subscription plan limitations and create more tunnels than authorized, potentially leading to resource abuse, service degradation, and circumvention of business logic controls.
Affected Products
- Outray (Node.js) versions prior to 0.1.5
- Outray open-source tunnel service
- Self-hosted Outray deployments
Discovery Timeline
- 2026-01-14 - CVE CVE-2026-22820 published to NVD
- 2026-01-20 - Last updated in NVD database
Technical Details for CVE-2026-22820
Vulnerability Analysis
This vulnerability stems from a classic TOCTOU race condition in the tunnel creation workflow. When a user requests a new tunnel, the application checks whether the user has reached their subscription's tunnel limit before granting the request. However, a timing gap exists between this validation check and the actual tunnel creation operation.
An attacker can exploit this window by sending multiple concurrent tunnel creation requests. If these requests are processed simultaneously, each individual request may pass the tunnel limit check before any of them complete the creation process. This allows the attacker to create more tunnels than their subscription permits.
The attack requires network access and precise timing, as the exploitation window is narrow. While the integrity impact is limited to bypassing subscription controls, the vulnerability undermines the application's business logic enforcement and could lead to resource exhaustion on shared infrastructure.
Root Cause
The root cause is insufficient synchronization in the subscription validation logic. The application performs a non-atomic check-then-act operation:
- Check phase: Query current tunnel count and compare against subscription limit
- Act phase: Create new tunnel and increment counter
Without proper locking or atomic operations, concurrent requests can interleave, with multiple threads passing the check phase before any complete the act phase.
Attack Vector
The attack is network-based and requires no authentication beyond a valid user account. An attacker can craft a script to send rapid, concurrent HTTP requests to the tunnel creation endpoint. The timing characteristics make this a probabilistic attack—success depends on server load, network latency, and the attacker's ability to time requests within the race window.
The exploitation mechanism involves concurrent API calls to the tunnel creation endpoint. By issuing multiple simultaneous requests, an attacker can bypass the subscription limit check before the tunnel count is updated, effectively creating more tunnels than authorized. For technical details, see the GitHub Security Advisory GHSA-3pqc-836w-jgr7.
Detection Methods for CVE-2026-22820
Indicators of Compromise
- Rapid succession of tunnel creation requests from a single user or IP address
- Users with active tunnel counts exceeding their subscription limits
- Anomalous spikes in concurrent API requests to tunnel creation endpoints
- Database inconsistencies between tunnel counts and subscription tiers
Detection Strategies
- Implement rate limiting alerts on tunnel creation API endpoints
- Monitor for users with tunnel counts exceeding subscription boundaries
- Deploy application performance monitoring (APM) to detect concurrent request anomalies
- Review API logs for burst patterns of tunnel creation attempts within millisecond windows
Monitoring Recommendations
- Enable detailed logging of all tunnel creation requests with timestamps
- Set up automated alerts for subscription limit threshold violations
- Monitor server resource utilization for unexpected increases in tunnel connections
- Implement real-time dashboards tracking tunnel allocation per subscription tier
How to Mitigate CVE-2026-22820
Immediate Actions Required
- Upgrade Outray to version 0.1.5 or later immediately
- Audit current tunnel allocations to identify any users exceeding subscription limits
- Review logs for evidence of exploitation attempts
- Consider temporarily implementing additional rate limiting on tunnel creation endpoints
Patch Information
The vulnerability has been fixed in Outray version 0.1.5. The fix addresses the race condition by implementing proper synchronization mechanisms in the tunnel creation workflow. The patch is available in commit 08c61495761349e7fd2965229c3faa8d7b1c1581.
For detailed information, refer to the GitHub Security Advisory GHSA-3pqc-836w-jgr7.
Workarounds
- Implement application-level rate limiting on tunnel creation requests
- Deploy a reverse proxy with request throttling to limit concurrent requests per user
- Add manual monitoring of tunnel counts versus subscription limits
- Consider implementing database-level constraints to enforce tunnel limits
# Example: Implement rate limiting with nginx (temporary workaround)
# Add to nginx configuration for Outray API endpoints
limit_req_zone $binary_remote_addr zone=tunnel_limit:10m rate=1r/s;
location /api/tunnels {
limit_req zone=tunnel_limit burst=2 nodelay;
proxy_pass http://outray_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

