Confidential-computing side-channel audit · 29 November 2026

NEAR AI GPU TEE: KV-cache side-channel, ignored opt-outs, and blind secret extraction

Hardware GPU Trusted Execution Environments (Intel TDX + NVIDIA H200 Confidential Computing) protect encrypted VRAM from the host operator—not from co-tenants sharing an unpartitioned prefix cache inside the enclave's inference server. While our cross-provider probes confirm that near-ai genuinely runs its own isolated TEE GPUs (0% bleed against Venice, Baseten, DeepInfra, CoreWeave, and AkashML), all 4 of 4 live NEAR AI endpoints on OpenRouter leave automatic KV prefix caching on at 94.2–99.9% for at least 3 full minutes idle, silently ignore all 6 standard opt-out/isolation flags, and allow 100% blind extraction of templated secrets using either cached_tokens or pure TTFT timing—including 1-of-12 M&A stock tickers for $0.0033 in 13.95 s.

Executive Summary — Key Findings at a Glance:

  • 94.2%–99.9% Cross-Tenant KV-Cache Bleed Inside Live GPU TEEs: All 4 / 4 live NEAR AI GPU TEE endpoints on OpenRouter leave shared prefix caching active for ≥3–4 minutes idle—even across completely separate OpenRouter accounts on different networks (full table).
  • 100% Blind Timing-Only Secret Extraction ($0.0033): Using pure TTFT latency with zero overlap (AUC = 1.000)—no cached_tokens field needed—an attacker extracted a 1-of-12 M&A stock ticker for $0.0033 in 13.95 s and 3 / 3 templated medical codes (interactive replay).
  • All 7 / 7 Opt-Out & Isolation Flags Silently Ignored: Passing cache_salt, store: false, user, or provider cache-disable controls on OpenRouter has zero effect on KV bleed (details).
  • Why GPU TEEs Still Leak (Root Cause & Who's Exposed): Hardware TEEs protect memory from the host operator, not from co-tenants sharing one unisolated GPU prompt cache—so anyone routing through a shared org key (such as OpenRouter) or using NEAR AI's third-party Chutes/Tinfoil TEE models leaks prompt-prefix hits across separate customers, letting another user detect whether you just sent a known template or secret (code audit · fleet X-ray).
  • Honest Credit & Verified Defense: NEAR-native enclaves genuinely run isolated Intel TDX + NVIDIA H200 TEEs (0% cross-provider bleed against Venice/Baseten/DeepInfra/CoreWeave/AkashML) and cryptographically bind pinned @sha256 container digests into Intel TDX mr_config_id; prepending a random client-side nonce cuts KV bleed to 0.0% (fix).
4 / 4
live NEAR AI GPU TEE models on OpenRouter bleed 94.2–99.9% cached tokens across distinct user IDs (16, 64, and 128-token blocks)
7 / 7
isolation & opt-out flags silently ignored via OpenRouter (user, prompt_cache_key, cache_salt, cache_prompt: false, store: false, zdr: true, temperature)
$0.0033
total attacker cost (in 13.95 s) to blindly extract 1-of-12 stock tickers (GOOG) inside the TEE via cache or TTFT timing alone (525 ms vs 946–1,338 ms)
≥ 3 min
uncontaminated idle KV residency inside the GPU TEE (99.5% hot at 180.0 s idle; evicted by 240.0 s)—dropped to 0.0% by a leading 128-bit nonce

1. Why a GPU TEE still leaks KV-cache state

NEAR AI Cloud's documentation states that its confidential endpoints run vLLM / SGLang inside Intel TDX confidential VMs attached to NVIDIA H200 GPUs in confidential-computing mode, with automatic prefix caching enabled by default and no documented cache_salt, per-tenant partitioning, or opt-out flag.

Hardware confidential computing encrypts GPU/CPU memory against the host OS, hypervisor, and cloud operator. Inside the attested enclave, however, the inference engine must hold decrypted tokens and live KV attention tensors in HBM. When multiple users share that inference process (for example, every OpenRouter user routed under OpenRouter's shared upstream key, or every end-user of a multi-tenant app behind one NEAR AI API key), an unsalted global KV prefix cache turns the TEE into a live cross-tenant oracle:

Victim (Alice) user="alice-private" cache_prompt=false (ignored) Co-tenant (Bob) user="bob-attacker" Probes candidates (+350ms–180s) OpenRouter / App Shared upstream NEAR AI API key zdr:true / user ignored PROTECTED BY INTEL TDX + H200 CC TEE (host OS / cloud admin blocked ✓) Multi-Tenant Inference Server Inside Enclave (vLLM / SGLang) UNSALTED GLOBAL KV-CACHE POOL (HBM) Block key = hash(tokens[0..15]), hash(tokens[16..31]), ... No tenant salt · No user/key isolation · Stays hot ≥ 180 s idle Alice's secret prefix hits 99.8% when Bob guesses right! LEAKAGE CHANNELS BACK TO BOB 1. cached_tokens: 7,408 vs 880 · 2. Blind TTFT: 525ms vs 946–1,338ms

2. Source-code root cause: auditing nearai/cloud-api, inference-proxy, & live attestation

Rather than guessing how NEAR AI isolates direct customers internally, we inspected NEAR AI's live public attestation endpoint (GET https://cloud-api.near.ai/v1/attestation/report?model=Qwen/Qwen3.8-27B, 243 KB, returning real Intel TDX quotes, 98 KB NVIDIA H200 evidence, and Dstack dstack-0.5.12 measurements) alongside NEAR AI's public open-source Rust repositories (nearai/cloud-api and nearai/inference-proxy@37c3f6d). What we found gives credit where credit is due—and pinpoints the exact root cause of the live exploit:

2C. Local raw-byte Intel TDX v4 hardware quote, nonce-freshness & compose verification

To verify NEAR AI's hardware TEE claims independently of any third-party verifier service, we wrote a local binary Intel DCAP TDX v4 quote parser (llmverify.forensics.verify_intel_tdx_v4_quote(), experiments/nearai_tdx_enclave_and_multiturn_audit.py, $0.00 cost) and checked 8 live models on cloud-api.near.ai/v1/attestation/report across two distinct fresh 32-byte nonces. Credit where due: all four NEAR-native enclaves passed 100% of cryptographic checks (valid TDX v4 header, DEBUG = 0, live per-request nonce binding on both n1 and n2, and exact mr_config_id == 0x01 || sha256(app_compose) binding pinned @sha256 container digests), while exposing exact live cluster sizes (1, 2, and 4 × 8×H200 nodes) and Chutes's separate sek8s 8×H200 / 8×B300 TDX quote format:

Model on cloud-api.near.aiBackendNodes × GPUsTDX v4 / DEBUG=0Fresh n1 & n2 in report_datamr_config_id = app_composeSigner / Instance ID
Qwen/Qwen3.8-27BNEAR native1 × 8×H200TDX v4 · DBG=0addr + n1 + n2 ✓Exact match ✓0x835ab53d20…
Qwen/Qwen3.8-27B-abliteratedNEAR native1 × 8×H200TDX v4 · DBG=0addr + n1 + n2 ✓Exact match ✓0x979121f480…
deepseek-ai/DeepSeek-V4.1-Flash-1017NEAR native2 × 8×H200TDX v4 · DBG=0addr + n1 + n2 ✓Exact match ✓0xfe00718955…
z-ai/glm-5.3-flashNEAR native4 × 8×H200TDX v4 · DBG=0addr + n1 + n2 ✓Exact match ✓0x3b753b4406…
deepseek/deepseek-v3.2 · kimi-k3 · kimi-k2.6Chutes (sek8s)8×H200 / 8×B300TDX v4 · DBG=0Custom sek8s rd (fresh per instance)n/a (quote_b64)58c0f98b… / 5c5a9255…
deepseek/deepseek-v4.1-flash-1017 · z-ai/glm-5.33P slug—HTTP 503 ("Provider error: Failed to fetch attestation report")

2D. Full-stack TEE architecture audit: Gateway TDX, OHTTP Ed25519, open-source compose-manager, 65-model census & E2EE v1/v2 tools gap

Going beyond the model-level quote, we cryptographically verified NEAR AI's entire public attestation chain across all 65 listed models (experiments/nearai_full_stack_tee_audit.py & experiments/nearai_65model_enclave_census.py, $0.00) alongside nearai/inference-proxy, nearai/compose-manager, and nearai/cvm-compose-files:

2B. Live 65-model fleet X-ray from public TEE attestations

Querying only NEAR AI's public unauthenticated GET /v1/models and GET /v1/attestation/report?model=… endpoints (experiments/nearai_attestation_fleet_xray.py, $0.00 cost) maps NEAR AI Cloud's entire 65-model catalog and live physical 8× NVIDIA H200 (Hopper) Intel TDX deployment topology:

Fleet Tier (cloud-api.near.ai)ModelsLive Hardware / Compose Stackcache_salt IsolationNotes
1P GPU TEE — PHYS-1 (Small Pack + GLM node 2)101× 8×H200 TDX · prod/pack-small-models.yaml@351acd44Direct orgs isolatedCo-hosts Qwen3.8-27B, -abliterated (rank-1 LoRA), Qwen3.6-35B, Qwen3-VL-30B, FLUX.2, whisper, privacy-filter, embeddings/reranker, plus z-ai/glm-5.3-flash (node 2, SGLang + 325 GiB HiCache) on the exact same 8 H200 dies (11 dstack.sock mounts)
1P GPU TEE — PHYS-2/3 (DeepSeek)22× 8×H200 TDX · deepseek-v4.1-flash-1017-vllm-dep4x2.yaml@b0f89e45Direct orgs isolated16 unique H200 dies; vLLM DEP4×2 hosting DeepSeek-V4.1-Flash-1017 & -abliterated (10/10 images pinned)
1P GPU TEE — PHYS-4/5 (GLM-5.3-Flash)12× 8×H200 TDX (+ PHYS-1) · pack-glm-53-flash-pd2-long.yaml@f7f20827 & glm-5.3-flash-vllm-pd2x2.yaml@c3598d40W4AFP8 vs OR "fp8"4 model_attestations collapse to 3 physical 8×H200 servers (PHYS-4 runs dual proxy-glm53 + proxy-glm53-long with 406 GiB HiCache on the same 8 H200s; PHYS-5 runs vLLM PD2×2). All 3 load graphistry/GLM-5.3-Flash-W4AFP8 despite OpenRouter's near-ai/fp8 tag!
Attested 3P (Chutes)4provider: "chutes" (deepseek-v3.2, kimi-k2.6, kimi-k3; glm-5.3 503)Never calls apply_upstream_cache_salt()Default OpenAI-SDK requests send no cache_salt under NEAR's shared CHUTES_API_KEY
External non-TEE passthrough49OpenAI (22), Anthropic (14), Google (6), xAI (2), DeepSeek (2), Moonshot (1), Levanto (1), Typesafe (1)Outside TEEE2EE rejected by reject_e2ee_if_unsupported()
OpenRouter-only listing1openai/gpt-oss-120b (near-ai/fp4 on OpenRouter)No public attestation (HTTP 400)Absent from cloud-api.near.ai/v1/models; /v1/attestation/report?model=openai/gpt-oss-120b returns HTTP 400

2E. NVIDIA H200 silicon X.509 tomography, TDX-attested fp8→W4AFP8 mismatch & single-shot cross-account agent tool bleed

Going down to the raw GPU silicon layer (experiments/nearai_deep_tee_v2_audit.py, $0.0016 total), we decoded the factory-fused NVIDIA Hopper GH100 X.509 certificate chains (CN=GH100 A01 GSP FMC LF signed by GH100 A01 GSP BROM, 5 certs/chain) and checked fresh 32-byte nonce binding at binary offset 4..36 inside every NVIDIA SPDM firmware evidence blob across all 12 NEAR-native models, then ran clean single-shot two-account OpenRouter probes (Account A → Account B, zero self-hit confounding):

2F. Hybrid Mamba/DeltaNet all-or-nothing KV cliff, privileged: true proxy containers & live Gateway TLS SPKI verification

Probing deeper into NEAR AI's live container runtime, Gateway TDX TLS binding, and prefix-cache physics (experiments/nearai_mamba_and_w4afp8_xray.py, $0.0092) turned up four crisp architectural findings:

2G. Hardware RTMR3 replay, 7-day auto-pruning of compose-manager logs, Mamba vision cliff & cross-account <think> bleed

Finally, we cryptographically replayed Intel TDX hardware RTMR3 across all 6 live CVMs, audited all 3 Chutes sek8s Hopper/Blackwell enclaves, and ran single-shot two-account multimodal and chain-of-thought probes (experiments/nearai_rtmr3_mamba_vision_and_reasoning_audit.py, $0.00081 total):

3. Interactive replay: live blind template-secret extraction inside the TEE

How practical is secret extraction? Whenever an enterprise, medical, financial, or agent app wraps a low-entropy secret inside a standard prompt template ([Header] + SECRET + [Long Boilerplate Suffix]), a wrong guess breaks KV prefix matching at the header boundary (e.g. token 880 or 1,328), while the true secret matches all the way through the multi-thousand-token suffix. Toggle between Cached Tokens and Blind Timing-Only (TTFT ms) below to inspect five real live extractions run against near-ai/fp8 (qwen/qwen3.8-27b):

Multi-replica honesty note: Look at the 1-of-12 ticker replay above: 7 of 12 probes (GOOG + 6 wrong tickers at 880 cached tokens) hit the warm replica, while 5 wrong tickers hit a separate cold replica (0 cached tokens). In a separate 2-stage test (4 sectors × 4 actions), all 4 Stage-1 probes happened to miss the warm replica (0 cached), while all 4 Stage-2 probes hit the warm replica cleanly (BUY: 8,448 / 820 ms vs. SELL/HOLD/SHORT: 4,016 / 1,165–1,231 ms). On a ~2-replica cluster, repeating each candidate 2–3× raises warm-replica hit probability above 85% while keeping total attack cost under a penny.

4. Zero-overlap timing oracle (AUC = 1.000) & 3-minute uncontaminated idle TTL

Even if NEAR AI removed cached_tokens from API responses completely, streaming prefill latency alone cleanly separates cached vs. uncached prompts. Across 5 paired 7.5k–8.0k token cold-vs-warm trials on near-ai/fp8 (user=alice → bob), every cold call took 1,029–1,397 ms and every warm call took 512–610 ms (a 419 ms zero-overlap gap, median −561 ms / 2.06×, AUC = 1.000). Across seven independent uncontaminated TTL prompts (each seeded once at t = 0 and probed once with zero touches in between), Alice's secret remained 99.5% hot at 180.0 s (3 full minutes idle!) and evicted between 3 and 4 minutes:

TIMING-ONLY ORACLE: 5 COLD vs. WARM TRIALS (7.5k–8k) near-ai/fp8 (qwen3.8-27b) · user=alice → bob · AUC = 1.000 0ms 500ms 1000ms 1500ms 419ms clean gap #1 1,137ms 553ms (2.06×) #2 1,138ms 578ms (1.97×) #3 1,397 610ms (2.29×) #4 1,054ms 513ms (2.05×) #5 1,029ms 512ms (2.01×) Cold (Alice) Warm +350ms (Bob) · med −561ms 7-POINT UNCONTAMINATED IDLE TTL (0–240 s) 7 separate 5.6k–6.4k prompts · zero touches between seed & probe 100% 50% 0% 0s 60s 120s 180s 240s 99.5–99.6% hot through 180.0 s 3 min: 602ms 4 min: 0% Eviction cliff: 180 s (3 min) < idle TTL ≤ 240 s (4 min)

5. All 4/4 NEAR AI TEE models & all 7/7 ignored opt-out flags

Scanning all 442 models on OpenRouter surfaced four live near-ai endpoints. Every single one bleeds 94.2–99.9% cached tokens across user="alice" → "bob", exhibits a consistent cold-to-warm TTFT speedup even at 5k tokens, and exposes its exact KV block granularity (16, 64, or 128 tokens). Even role: system secrets bleed identically (5,024 / 5,049 = 99.5%), and all seven opt-out/isolation parameters—including NEAR AI's own cache_salt field—are silently ignored or stripped via OpenRouter:

Model @ NEAR AI EndpointCross-provider isolationuser bleed (3 trials)KV block size5k–8k Cold → Warm TTFTVerdict
qwen/qwen3.8-27b @ near-ai/fp80% vs deepinfra99.3–99.6% (3/3)16 tok1,137 → 553 ms (2.06×, 5/5)Bleeds + AUC 1.0
openai/gpt-oss-120b @ near-ai/fp40% vs venice/cw/ak99.4–99.9% (3/3)16 tok735 → 575 ms (1.29×, 3/3)Bleeds (48-tok prewarm)
deepseek-v4.1-1017 @ near-ai0% vs baseten/venice98.5–99.1% (3/3)64 tok684 → 554 ms (1.33×, 3/3)Bleeds
z-ai/glm-5.3-flash @ near-ai/fp8own TEE pool94.2–96.6% (3/3)128 tok922 → 689 ms (1.34×, 2/3)Bleeds
Isolation / Opt-Out Attempt (near-ai/fp8)Alice cold writeBob probe (+350 ms)Cross-hitVerdict
user="alice" vs "bob"0 / 7,323 (1,332 ms)7,296 / 7,323 (997 ms)99.6%Silently ignored
prompt_cache_key="alice-vault" vs "bob-vault"0 / 4,477 (1,511 ms)4,448 / 4,477 (1,478 ms)99.4%Silently ignored
cache_salt="alice-salt-111111" vs "bob-salt-999999"0 / 3,861 (851 ms)3,840 / 3,861 (552 ms)99.5%Stripped by OpenRouter
cache_prompt: false0 / 4,562 (761 ms)4,544 / 4,562 (586 ms)99.6%Silently ignored
store: false0 / 4,452 (4,693 ms)4,432 / 4,452 (633 ms)99.6%Silently ignored
OpenRouter provider: {zdr: true}0 / 4,355 (1,234 ms)4,336 / 4,355 (548 ms)99.6%Silently ignored
temperature: 0.0 vs 0.90 / 4,370 (913 ms)4,352 / 4,370 (565 ms)99.6%Silently ignored
Secret placed inside role: "system"0 / 5,049 (925 ms)5,024 / 5,049 (720 ms)99.5%System prompt bleeds

6. 7-axis security & fidelity battery across all 4 NEAR AI models

Beyond KV caching, we ran our 7-axis security & fidelity audit (experiments/nearai_full_forensics_audit.py, $0.0011) across all 4 live NEAR AI endpoints. The results are mixed—strong on raw logprob honesty, strict JSON schema, and forced tool calling, but exposing live special-token multi-turn role forgery and ignored stop sequences on deepseek-v4.1-flash-1017 plus ignored frequency_penalty on two models:

Model @ NEAR AISpecial-token isolationLogprobs / Braggstop sequenceStrict json_schemafrequency_penalty=2Forced tool_choice
deepseek-v4.1-1017 @ near-aiRole forgery (−31 tok, '2' vs '1')BF16_1/8 · raw LPIgnored (leaked marker)PassIgnored (18 vs 18)Pass
qwen3.8-27b @ near-ai/fp8Collapsed −14 tokBF16_1/16 · raw LPPassPassIgnored (18 vs 18)Pass
gpt-oss-120b @ near-ai/fp4PassBF16_1/8 · raw LPPassPassHonored (18→15)Pass
glm-5.3-flash @ near-ai/fp8Pass (Δ=−4)reasoning-only (short cap)Passempty (reasoning cap)empty (reasoning cap)Pass

7. Practical threat model: what attackers CAN and CANNOT read

To keep the risk assessment exact and free of hype:

Attack scenarioPractical today?Why
Read an arbitrary unknown free-form prompt (e.g. a unique diary entry or novel email)No / ImpracticalBlocks match in 16-token (or 64–128-token) chunks. Brute-forcing 16 unknown free-form tokens simultaneously is infeasible.
Extract secrets inside known templates (medical triage, trading/M&A memos, RAG/compliance forms, agent workflows)Very practical ($0.003)Probing N candidate values (4 diagnoses, 12 tickers, 50 states, yes/no flags) costs fractions of a cent within the 3-minute window and recovers the exact secret via cache or TTFT.
Document / prompt-existence oracle ("Did someone send this leaked contract / filing / query in the last 3 minutes?")Trivial (1 probe)One max_tokens=1 call every ~150 s immediately reveals residency with AUC = 1.000 even without cached_tokens.
Fingerprint active public agent prompts & repos (coding agents, open-source RAG system prompts)TrivialMulti-thousand-token public system prompts light up immediately (our first cold call to gpt-oss-120b @ near-ai/fp4 already hit 48 pre-warmed tokens).

8. Verified client-side defense (0.0% bleed) & exact server/OpenRouter fix

Until NEAR AI patches the server, privacy-sensitive callers can completely neutralize cross-tenant KV bleed today by prepending a fresh 128-bit random nonce inside the first 16 tokens of the prompt. Placement matters: a leading nonce breaks block-0 hashing and drops bleed to 0.0% across 3/3 live trials, whereas a trailing nonce placed at the end of the prompt still bleeds 86.3%!

Client-side defense test (near-ai/fp8)Alice writeBob probe (+350 ms)Cross-hitResult
Leading 128-bit nonce (Trial 1)0 / 5,828 (1,157 ms)0 / 5,827 (1,087 ms)0.0%100% isolated
Leading 128-bit nonce (Trial 2)0 / 5,977 (930 ms)0 / 5,978 (891 ms)0.0%100% isolated
Leading 128-bit nonce (Trial 3)0 / 5,973 (1,112 ms)0 / 5,972 (890 ms)0.0%100% isolated
Trailing 128-bit nonce (anti-pattern)0 / 5,707 (1,057 ms)4,928 / 5,708 (765 ms)86.3%Still leaks!
Unprotected 2-turn chat (assistant reply turn!)0 / 3,7823,136 / 3,781 (diff asst: 0)82.9%Assistant turn bleeds!
Leading 128-bit nonce in Turn 1 (2-turn chat)0 / 4,0470 / 4,0470.0%Assistant turn isolated
Multimodal 1280×960 PNG (same text, distinct user)0 / 1,2191,200 / 1,219 (recomp PNG: 0)98.4%Image KV bleeds!

Immediate developer workaround (breaks cross-tenant prefix matching at block 0; reuse the same session_salt across turns of a single private conversation if you want single-user multi-turn caching without cross-user bleed):

import secrets
session_salt = secrets.token_hex(16)  # fresh per private user/session (first 16 tokens!)
messages = [{"role": "system", "content": f"[session:{session_salt}]\n" + system_prompt}, ...]

Exact 5-line fixes for OpenRouter & NEAR AI:

9. Scope, honest boundaries, and open questions

More from LLM Verification

Standalone audit · Chutes SN64
Chutes TEE KV bleed, MD5 magnet & stream hangs

Stripped cache_salt & logprobs, 97.8–99.5% Try-1 two-account bleed across 65 instances, and verified sek8s hardware.

Provider audit · Venice AI
Venice ZDR cross-provider KV bleed

Bidirectional 90–99.4% KV-cache bleed across Venice, Baseten, and DeepInfra on three models.

Topology · 26 pairs
Cross-provider & tier KV-bleed map

Full SVG topology graph comparing reseller bleed, shared tiers, and verified isolated clusters.

Case study · Wafer & Baseten
Phantom fp32 tags & 3.73× price gap

Baseten's fp32/fp8 alias and Wafer's identical-pool regional price arbitrage.

Fleet audit · 115 endpoints & 18 providers
O(N) KV-bleed dragnet & opt-out leaderboard

15/18 providers ignore opt-outs (OpenAI 1P & DeepSeek 1P isolate), plus blind O(log N) reseller detection & CLI.

Interactive · Bragg X-ray
LLM Logit Crystallography

Single-call FP16 vs BF16 diffraction spectra and blind hidden-temperature recovery.

Measured 2026-11-29 via OpenRouter API against all 4 live NEAR AI GPU TEE endpoints. Scripts and raw JSON in llm-verification (experiments/precision_alias_and_tee_ttl_audit.py, experiments/nearai_tee_deep_forensics.py, experiments/nearai_tee_part2_extraction_and_defense.py, experiments/nearai_tdx_enclave_and_multiturn_audit.py, experiments/nearai_full_stack_tee_audit.py, experiments/nearai_65model_enclave_census.py, experiments/nearai_gpu_compose_audit.py, experiments/nearai_deep_tee_v2_audit.py, experiments/nearai_mamba_and_w4afp8_xray.py, experiments/nearai_rtmr3_mamba_vision_and_reasoning_audit.py). Corrections or patch confirmations from NEAR AI or OpenRouter are welcome and will be re-tested and reflected here. Method & limits