# SGLang RCE Flaw Inside TEE Breaches NEAR AI Servers

*Updated on November 9, 2026*

NEAR AI has disclosed a production security breach in which an attacker exploited a remote code execution (RCE) vulnerability in `SGLang`, the open-source LLM inference engine, to gain code execution inside one of NEAR AI's confidential computing servers on Sunday, November 8, 2026. Because `SGLang` executed directly inside the Trusted Execution Environment (TEE), the attacker was positioned to observe live user inference requests processed on that node during the compromise, including prompts submitted in confidential mode.

From that initial inference foothold, the attacker pivoted into internal NEAR AI systems behind a deprecated product called Private Chat, downloading names, email addresses, and plan/balance metadata for roughly `100 users`. The intruder also accessed `18 AI agents` hosted on a legacy NEAR AI Agents deployment running outside the TEE, exfiltrating agent chat histories, configuration settings, and execution logs, while exposing `2` customer NEAR AI Cloud API keys stored in logs.

This incident delivers a sharp architectural wake-up call for every enterprise security team relying on hardware confidential computing (such as Intel TDX, AMD SEV-SNP, or NVIDIA H100/B200 Confidential Computing) to protect sensitive AI prompts. Hardware enclaves encrypt memory against a curious cloud host, datacenter technician, or hypervisor, **not** against an unpatched RCE vulnerability inside the Python/C++ inference engine running inside the enclave itself.

Upon detecting the intrusion, NEAR AI revoked all active sessions and administrative credentials, rotated all agent tokens and the `2` exposed customer API keys, took Private Chat permanently offline, patched the `SGLang` vulnerability across its inference fleet, and reported the bug upstream to `SGLang` maintainers. While NEAR AI found no evidence that stored Private Chat conversations or uploaded files were read, the company has not yet published a CVE identifier or exact affected `SGLang` version range, so self-hosted `SGLang` operators must harden network and credential boundaries around their serving containers immediately.

<a aria-hidden="true" id="executive-fast-facts"></a>  Fast Facts

- **Attack Vector**: Remote code execution (RCE) vulnerability exploited in the open-source `SGLang` inference engine running inside a production server on November 8, 2026, documented in the [NEAR AI SGLang security incident report](https://near.ai/blog/security-incident-report-sglang-vulnerability).
- **Confidential Computing Impact**: Because `SGLang` ran inside the Trusted Execution Environment (TEE), live user requests processed on the compromised node on November 8, including confidential-mode traffic, could have been observed in plaintext inside enclave memory.
- **Confirmed Lateral Blast Radius**: Account details (names, emails, plan/balance info) for `~100 users` of deprecated Private Chat; chat histories, settings, and logs for `18` legacy non-TEE agents; and `2` customer NEAR AI Cloud API keys in logs.
- **Unaffected Data**: Forensic review found no indication that stored Private Chat conversation archives or uploaded files were accessed.
- **Ecosystem Downstream Context**: Third-party privacy products, including Brave's Leo browser assistant (which routes `GLM 5.3 Flash` chats through NEAR AI TEEs per Brave's October 15 architecture post), rely on enclave-backed inference stacks.

## Threat Model Reality Check: What Hardware TEEs Do and Do Not Protect

Marketing around "verifiable private AI" frequently leads enterprise buyers to treat TEE attestation as a blanket guarantee of zero prompt exposure. NEAR AI's postmortem illustrates the exact boundary between hardware memory isolation and application-layer exploitability.

| Security Layer / Threat Scenario | Protected by Hardware TEE Alone? | What Happened in the NEAR AI Breach | Required Defense-in-Depth Control |
|---|---|---|---|
| **Cloud Host / Hypervisor Memory Snooping** | Yes (Hardware-encrypted RAM) | Enclave protected against host operator inspection | Remote cryptographic attestation |
| **RCE in Inference Server (`SGLang` / `vLLM`)** | **No (Runs inside trusted enclave)** | **Attacker achieved code execution inside `SGLang` process** | Sandboxed worker processes + seccomp + rapid patching |
| **Lateral Movement to Internal Services** | **No (If enclave holds internal creds)** | **Attacker pivoted to Private Chat DB &amp; 18 legacy agents** | Zero-trust egress rules; zero internal VPC credentials in TEE |
| **API Keys Written to Agent / Server Logs** | **No (Plaintext in log sinks)** | **2 customer Cloud API keys exposed in logs** | Automated Bearer/API token redaction before log write |

Two separate architectural lessons stand out from the forensic timeline. First, inference engines like `SGLang` and `vLLM` parse complex HTTP payloads, multimodal image/video decoders, custom tokenizer templates, and ZeroMQ/pickle inter-process messages at the network edge. If an inference node holds ambient network reachability or IAM credentials into internal control-plane databases, a single deserialization or parser RCE turns a stateless GPU worker into an internal breach pivot. Second, deprecated legacy services (`Private Chat` and non-TEE legacy agent hosts) remained reachable from production networks long after product deprecation, multiplying the blast radius of what could have been an isolated single-node memory event.

## Hardening Self-Hosted SGLang and Confidential Inference Fleets

Because upstream `SGLang` deployments power thousands of enterprise and neocloud endpoints while CVE specifics remain under coordinated disclosure, infrastructure engineers running `SGLang`, `vLLM`, or TEE inference nodes should apply strict containment rules right away:

```
# Kubernetes NetworkPolicy: Isolate SGLang GPU inference pods from internal control planes
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: isolate-sglang-inference-enclave
namespace: ai-serving
spec:
podSelector:
 matchLabels:
   app: sglang-worker
policyTypes:
 - Ingress
 - Egress
ingress:
 - from:
     - namespaceSelector:
         matchLabels:
           role: api-gateway
   ports:
     - protocol: TCP
       port: 30000
egress: [] # Block all outbound lateral movement to internal DBs, metadata IPs, and legacy services
```

Pair network egress blocking with three operational checks:

- **Strip Control-Plane Credentials From GPU Inference Containers**: Inference workers inside or outside a TEE only need read-only model weights and an inbound socket from the gateway. Never mount AWS/GCP IAM roles, internal database DSNs, or admin tokens inside `SGLang` containers.
- **Disable Unsafe Deserialization &amp; Multimodal URL Fetching**: Ensure `SGLang` is not configured to fetch arbitrary user-supplied remote media URLs from inside the GPU worker, and audit IPC flags so untrusted inputs never hit Python `pickle` paths.
- **Decommission Deprecated AI Microservices Completely**: Shut down and snapshot-archive legacy chat/agent staging databases rather than leaving deprecated services online on internal subnets.

  Next Steps

1. **Rotate NEAR AI Cloud Keys and Audit November 8 Traffic**: If your application or team routed sensitive prompts or agent workflows through NEAR AI on November 8, 2026, verify whether `security@near.ai` contacted your account and proactively rotate any credentials passed inside prompt payloads that day.
2. **Enforce Zero-Egress Network Policies on Self-Hosted SGLang Pods**: Lock down all `SGLang` and `vLLM` GPU serving containers with default-deny outbound firewall rules (`egress: []`) so an inference RCE cannot reach internal VPC services or cloud metadata endpoints (`169.254.169.254`).
3. **Scrub API Keys From Agent Execution Logs**: Audit structured logging middleware across your agent runners to ensure `Authorization` headers and `sk-*` / `Bearer` keys are cryptographically hashed or redacted prior to storage.