# CVE-2026-86793: CVE-2026-86793

The Markdown version of <https://upatch.dev/cve/CVE-2026-86793>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-86793 is rated Critical 9.8 (CVSS 3.1, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). It affects SGLang and was published on 11 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.9%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-86793-sglang-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-86793, published on 11 September 2026, is an unauthenticated remote code execution vulnerability in SGLang (versions up to and including 0.5.21 in the CVE record, fixed after 0.5.14 in the main branch via pull requests #39858 and #40259). When SGLang is started without authentication keys configured, the `/update_weights_from_tensor` endpoint (`AuthLevel.ADMIN_OPTIONAL` in `python/sglang/srt/entrypoints/http_server.py`) accepts base64-encoded pickle payloads in `serialized_named_tensors` and passes them to `MultiprocessingSerializer.deserialize` (`SafeUnpickler.load()` in `python/sglang/srt/utils/common.py`). Because `SafeUnpickler.ALLOWED_MODULE_PREFIXES` allows `"builtins."` and `DENY_CLASSES` omits `builtins.__import__` and `builtins.getattr`, a pickle payload can resolve `builtins.__import__` and `builtins.getattr` through `SafeUnpickler.find_class()` and chain them via `REDUCE` to import `os` and call `os.system` or spawn a subprocess.

### Official description

SGLang allows unauthenticated pickle deserialization through /update_weights_from_tensor when no auth keys are configured, and the SafeUnpickler policy can be bypassed because builtins.import and builtins.getattr are resolvable, enabling code execution via pickle REDUCE.

## What the upatch does

The BPF LSM program attaches to `lsm/bprm_check_security` and returns `-EPERM` when the calling task or its `real_parent` has a task `comm` starting with `sglang` (such as `sglang` or `sglang::scheduler`). When an attacker bypasses `SafeUnpickler` to run a shell command via `os.system` (which forks a child and executes `/bin/sh`) or `subprocess.Popen`, the kernel refuses the `execve` call with `EPERM`.

The `refused` per-CPU array map counts refused execution attempts at key 0.

The policy: [`cve-2026-86793-sglang-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-86793), 64 lines of BPF C attached at `lsm/bprm_check_security`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- SGLang processes whose `comm` starts with `sglang` (and their direct forked children) cannot execute new external binaries via `execve` after startup.
- Normal tensor deserialization and HTTP inference handling inside Python continue to work, while any attempt by a worker or server process to spawn a shell or external command fails with `EPERM`.
- Not covered: Pure in-memory Python actions that do not call `execve`, or an SGLang process started under a process name that does not begin with `sglang`.

## Preemption model and cost

The program keeps no shared state beyond the per-CPU `refused` counter, which it increments with `__sync_fetch_and_add`, making it safe under all preemption models including preemptible RCU and `PREEMPT_LAZY`. On every `execve`, the program reads the current task's 16-byte `comm` and, if needed, its parent's `comm`, returning immediately when neither starts with `sglang`.

## Affected versions

SGLang:

| Version                              | Status   |
| ------------------------------------ | -------- |
| <= 0.5.14 (<= 0.5.21 per CVE record) | Affected |
| main after PR #39858 and PR #40259   | Fixed    |

Kernels: any Linux kernel supported by shirudo with BPF LSM and BTF enabled.

## How it was tested

On SGLang v0.5.14, the loaded upatch refused subprocess execution triggered through SafeUnpickler deserialization on /update_weights_from_tensor before and after comparison.

- **Tested:** 25 Nov 2026
- **Target:** SGLang v0.5.14 (/update_weights_from_tensor with SafeUnpickler), loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | Subprocess execve via SafeUnpickler blocked |
| --------------- | ------------------------------------------- |
| Before loading  | no (reached)                                |
| Upatch loaded   | yes (EPERM)                                 |
| After unloading | no (reached)                                |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-86793
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-86793-1.0.0.bee oci://<registry>/<namespace>/cve-2026-86793 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-86793-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-86793 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-86793)
- [VicOne advisory](https://vicone.com/blog/cve-2026-86793-sglang-bypass-could-let-attackers-run-code-on-ai-servers/)
- [Fix PR #39858 (commit ae614766b73c)](https://github.com/sgl-project/sglang/pull/39858)
- [Fix PR #40259 (commit 0e521556eae5)](https://github.com/sgl-project/sglang/pull/40259)
- [SGLang v0.5.14 release](https://github.com/sgl-project/sglang/releases/tag/v0.5.14)

### Links

- [CVE-2026-86793 on upatch.dev](https://upatch.dev/cve/CVE-2026-86793) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-86793)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-86793)
- [CWE-94](https://cwe.mitre.org/data/definitions/94.html)
- Upatch source: [upatches/cve-2026-86793](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-86793)

### More references from NVD (4)

- [github.com](https://github.com/sgl-project/sglang/pull/39858)
- [github.com](https://github.com/sgl-project/sglang/pull/40259)
- [github.com](https://github.com/sgl-project/sglang/tree/main)
- [vicone.com](https://vicone.com/blog/cve-2026-86793-sglang-bypass-could-let-attackers-run-code-on-ai-servers/)
