Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-12811

CVE-2026-12811: Kortix-AI Suna XSS Vulnerability

CVE-2026-12811 is a cross-site scripting flaw in Kortix-AI Suna up to version 0.8.38 affecting the Auth Endpoint. Attackers can manipulate the returnURL parameter remotely. This article covers technical details, affected versions, impact, and mitigation steps.

Published:

CVE-2026-12811 Overview

CVE-2026-12811 is a cross-site scripting (XSS) vulnerability [CWE-79] in kortix-ai suna versions up to and including 0.8.38. The flaw resides in the router.replace/router.push function within apps/frontend/src/app/auth/page.tsx of the Auth Endpoint component. An attacker can manipulate the returnUrl argument to inject script content that executes in the victim's browser context. The attack can be launched remotely and requires user interaction. A public exploit is available, increasing the likelihood of opportunistic abuse. The maintainers addressed the issue in version 0.8.39 via commit f5dec7aa0c1b8fa0125938f292c0f2430ca75f6c without issuing a broad security disclosure.

Critical Impact

Remote attackers can deliver crafted authentication URLs that trigger script execution in the context of the suna application, enabling session theft, credential harvesting, or unauthorized redirects.

Affected Products

  • kortix-ai suna versions up to 0.8.38
  • Component: Auth Endpoint (apps/frontend/src/app/auth/page.tsx)
  • Component: Auth Callback Route (apps/web/src/app/auth/callback/route.ts)

Discovery Timeline

  • 2026-06-21 - CVE-2026-12811 published to the National Vulnerability Database (NVD)
  • 2026-06-23 - Last updated in NVD database
  • 2026-06-25 - EPSS scoring recorded for CVE-2026-12811

Technical Details for CVE-2026-12811

Vulnerability Analysis

The vulnerability is a reflected cross-site scripting issue in the authentication flow of the suna frontend. The auth/page.tsx route reads a user-controlled returnUrl parameter and passes it directly to Next.js navigation helpers router.replace and router.push. Because the value is not validated or restricted to safe in-application paths, an attacker can supply a javascript: URI or other crafted payload that the router accepts. When a victim follows a malicious link and completes the authentication step, the navigation primitive executes the attacker-controlled URI inside the application origin.

Exploitation requires a victim to click a crafted link, which limits scope but does not require attacker authentication. Successful exploitation runs script in the authenticated user's origin, enabling session token theft and follow-on account takeover.

Root Cause

The root cause is missing sanitization of the returnUrl query parameter before it is consumed by client-side navigation. The patched code introduces a helper sanitizeAuthReturnUrl that enforces allow-list checks on the return target, blocking unsafe schemes and off-origin destinations.

Attack Vector

A remote attacker crafts a URL pointing to the suna authentication page with a malicious returnUrl value. The attacker delivers the link via phishing, chat, or another web context. After the victim authenticates, the application invokes router.push or router.replace against the attacker-supplied value, executing the injected payload in the victim's browser session.

typescript
// Patch: apps/web/src/app/auth/callback/route.ts
 import { NextResponse } from 'next/server'
 import type { NextRequest } from 'next/server'
 import { ACTIVE_INSTANCE_COOKIE } from '@/lib/instance-routes'
+import { sanitizeAuthReturnUrl } from '@/lib/auth/return-url'
 
 /**
  * Auth Callback Route - Web Handler

Source: GitHub Suna Commit f5dec7a

typescript
// Patch: apps/web/src/app/auth/page.tsx
 import { WallpaperBackground } from '@/components/ui/wallpaper-background';
 import { cn } from '@/lib/utils';
 import { AuthBrowserNoiseGuard } from '@/components/auth/auth-browser-noise-guard';
+import { sanitizeAuthReturnUrl } from '@/lib/auth/return-url';
 
 // Lazy load heavy components
 const GoogleSignIn = lazy(() => import('@/components/GoogleSignIn'));

Source: GitHub Suna Commit f5dec7a

The patches import a new sanitizeAuthReturnUrl helper and apply it before any router navigation that consumes the returnUrl parameter.

Detection Methods for CVE-2026-12811

Indicators of Compromise

  • Inbound requests to /auth containing returnUrl parameters with javascript:, data:, or off-origin URLs
  • Authentication redirects to external hosts not listed in the application allow-list
  • Browser console errors or anomalous script execution during the auth flow on suna deployments running <= 0.8.38

Detection Strategies

  • Inspect web server and reverse proxy logs for returnUrl query parameters containing URL-encoded scripting schemes or non-relative paths.
  • Deploy Content Security Policy (CSP) reporting to surface violations triggered by injected payloads in the auth route.
  • Compare deployed suna build hashes against v0.8.39 to identify unpatched frontends.

Monitoring Recommendations

  • Alert on authentication attempts followed by client-side navigation to external or non-standard URI schemes.
  • Monitor for clusters of users receiving identical crafted auth links via email or messaging gateways.
  • Track post-authentication session anomalies such as unusual API calls or token reuse from new geolocations.

How to Mitigate CVE-2026-12811

Immediate Actions Required

  • Upgrade kortix-ai suna to version 0.8.39 or later, which includes commit f5dec7aa0c1b8fa0125938f292c0f2430ca75f6c.
  • Audit existing deployments for prior exploitation by reviewing auth-related access logs for malicious returnUrl values.
  • Rotate session tokens and API keys for users who may have followed untrusted authentication links.

Patch Information

The vendor fixed CVE-2026-12811 in suna release v0.8.39. The fix introduces sanitizeAuthReturnUrl in @/lib/auth/return-url and applies it within apps/web/src/app/auth/page.tsx and apps/web/src/app/auth/callback/route.ts. Additional detail is available in the GitHub commit and the VulDB entry for CVE-2026-12811.

Workarounds

  • Add a reverse-proxy or WAF rule to drop requests to /auth where returnUrl is not a relative path starting with /.
  • Enforce a strict Content Security Policy that blocks inline scripts and disallows javascript: URIs in navigation.
  • Restrict allowed redirect destinations to a server-side allow-list of internal application routes.
bash
# Example nginx rule: reject auth requests with unsafe returnUrl values
location /auth {
    if ($arg_returnUrl ~* "^(javascript:|data:|https?:)") {
        return 400;
    }
    proxy_pass http://suna_frontend;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.