{"id":"CVE-2026-22819","aliases":["CVE-2026-22819","GHSA-45hj-9x76-wp9g"],"related":[],"kind":"vulnerability","state":"published","title":"Outray has a Race Condition in main/apps/web/src/routes/api/$orgSlug/subdomains/index.ts","summary":"Outray openSource ngrok alternative. Prior to 0.1.5, this vulnerability allows a user i.e a free plan user to get more than the desired subdomains due to lack of db transaction lock mechanisms in main/apps/web/src/routes/api/$orgSlug/subdomains/index.ts. This vulnerability is fixed in 0.1.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Outray openSource ngrok alternative. Prior to 0.1.5, this vulnerability allows a user i.e a free plan user to get more than the desired subdomains due to lack of db transaction lock mechanisms in main/apps/web/src/routes/api/$orgSlug/subdomains/index.ts. This vulnerability is fixed in 0.1.5.","source":"cvelist"},{"lang":"en","text":"### Summary\nThis vulnerability allows a user i.e a free plan user to get more than the desired subdomains due to lack of db transaction lock mechanisms in `https://github.com/akinloluwami/outray/blob/main/apps/web/src/routes/api/%24orgSlug/subdomains/index.ts`\n\n### Details\n- The affected code-:\n\n```ts\n//Race condition\n        const [subscription] = await db\n          .select()\n          .from(subscriptions)\n          .where(eq(subscriptions.organizationId, organization.id));\n\n        const currentPlan = subscription?.plan || \"free\";\n        const planLimits = getPlanLimits(currentPlan as any);\n        const subdomainLimit = planLimits.maxSubdomains;\n\n        const existingSubdomains = await db\n          .select()\n          .from(subdomains)\n          .where(eq(subdomains.organizationId, organization.id));\n\n        if (existingSubdomains.length >= subdomainLimit) {\n          return json(\n            {\n              error: `Subdomain limit reached. The ${currentPlan} plan allows ${subdomainLimit} subdomain${subdomainLimit > 1 ? \"s\" : \"\"}.`,\n            },\n            { status: 403 },\n          );\n        }\n\n        const existing = await db\n          .select()\n          .from(subdomains)\n          .where(eq(subdomains.subdomain, subdomain))\n          .limit(1);\n\n        if (existing.length > 0) {\n          return json({ error: \"Subdomain already taken\" }, { status: 409 });\n        }\n\n        const [newSubdomain] = await db\n          .insert(subdomains)\n          .values({\n            id: crypto.randomUUID(),\n            subdomain,\n            organizationId: organization.id,\n            userId: session.user.id,\n          })\n          .returning();\n```\n\n- The first part of the code checks the user plan and determine his/her existing_domains without locking the transaction and allowing it to run.\n```ts\nconst existingSubdomains = await db\n          .select()\n          .from(subdomains)\n          .where(eq(subdomains.organizationId, organization.id));\n```\n\n- The other part of the code checks if the desired domain is more than the limit.\n\n```ts\nif (existingSubdomains.length >= subdomainLimit) {\n          return json(\n            {\n              error: `Subdomain limit reached. The ${currentPlan} plan allows ${subdomainLimit} subdomain${subdomainLimit > 1 ? \"s\" : \"\"}.`,\n            },\n            { status: 403 },\n          );\n        }\n```\n\n- Finally, it inserts the subdomain also after the whole check without locking transactions.\n\n```ts\nconst [newSubdomain] = await db\n          .insert(subdomains)\n          .values({\n            id: crypto.randomUUID(),\n            subdomain,\n            organizationId: organization.id,\n            userId: session.user.id,\n          })\n          .returning();\n```\n- An attacker can exploit this by making parallel requests to the same endpoint and if the second request reads row `subdomains` before the `INSERT` statement  of request one is made.It allows the attacker to act on a not yet updated row which bypasses the checks and allow the attacker to get more subdomains.For example-:\n\n```\n  Parallel request 1                               Parallel  Request  2    \n     |                                                                     |\nchecks for                                                     Checks the not yet updated\navailable subdomain                                     row and bypasses the logic checks\nand determines if it is more than limit\n    |                                                                        |\nInserts subdomain and calls it a day           Also inserts the  subdomain\n```\n-  The attack focuses on exploiting the race window between reading and writing the db rows.\n\n### PoC\n\n- Intercept with Burp proxy,pass to `Repeater` and create multiple requests in a single batch with different subdomain names as seen below. Lastly, send the requests in `parallel`.\n\n<img width=\"1844\" height=\"855\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f46d5993-31bd-4b96-902a-b2de5b0518bd\" />\n\n- Result-:\n\n<img width=\"1905\" height=\"977\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4c877de2-4b55-46f4-9f1c-78590dfebefc\" />\n\n\n### Impact\nThe vulnerability provides an infiinite supply of domains to users bypassing the need for subscription","format":"markdown","source":"ghsa"},{"lang":"es","text":"Outray, alternativa de código abierto a ngrok. Antes de la versión 0.1.5, esta vulnerabilidad permite a un usuario, es decir, un usuario de plan gratuito, obtener más subdominios de los deseados debido a la falta de mecanismos de bloqueo de transacciones de base de datos en main/apps/web/src/routes/api/$orgSlug/subdomains/index.ts. Esta vulnerabilidad está corregida en la versión 0.1.5.","source":"nvd"}],"published":"2026-01-13T21:53:30.000Z","modified":"2026-06-17T10:20:29.180Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","score":3.1,"rating":"LOW"}],"cwes":["CWE-366"],"affected":[{"ranges":[{"version":"< 0.1.5","status":"affected"}],"vendor":"akinloluwami","product":"outray","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.1.5"}],"ecosystem":"npm","package":"outray","purl":"pkg:npm/outray","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.1.5"}],"vendor":"outray","product":"outray","cpe":"cpe:2.3:a:outray:outray:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/outray-tunnel/outray/security/advisories/GHSA-45hj-9x76-wp9g","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/outray-tunnel/outray/commit/73e8a09575754fb4c395438680454b2ec064d1d6","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/akinloluwami/outray/security/advisories/GHSA-45hj-9x76-wp9g","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22819","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/outray-tunnel/outray/commit/08c61495761349e7fd2965229c3faa8d7b1c1581","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/akinloluwami/outray","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-01-14T21:13:28.883Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22819","url":"https://www.cve.org/CVERecord?id=CVE-2026-22819","licence":"CVE Terms of Use","modified":"2026-01-14T21:13:36.389Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-45hj-9x76-wp9g","url":"https://github.com/advisories/GHSA-45hj-9x76-wp9g","licence":"CC-BY-4.0","modified":"2026-02-03T02:58:52.332Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22819","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22819","licence":"Public domain","modified":"2026-06-17T10:20:29.180Z"}],"updatedAt":"2026-11-25T22:59:12.832Z","epss":{"score":0.00245,"percentile":0.16789,"date":"2026-12-01T12:00:22.000Z"}}