# CVE-2026-90770: Spug through 3.4.0 Remote Code Execution via ping_check

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

## At a glance

CVE-2026-90770 is rated High 8.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects Spug (openspug) and was published on 13 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 1.3%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-90770-spug-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-90770, "Spug through 3.4.0 Remote Code Execution via ping_check", was published on 13 September 2026. In `spug_api/apps/monitor/executors.py`, `ping_check(addr)` builds `f'ping -c 1 -W 3 {addr}'` and runs it with `subprocess.run(command, shell=True, stdout=subprocess.PIPE)`. The `run_test` view in `spug_api/apps/monitor/views.py` passes `form.targets[0]` from a request to `/monitor/test/` directly to `dispatch()`, which calls `ping_check()` when `form.type == '5'`. An authenticated user with the `monitor.monitor.add` or `monitor.monitor.edit` permission can supply shell metacharacters in `targets[0]` and execute arbitrary commands as the Spug process user.

### Official description

Spug through 3.4.0 contains a remote code execution vulnerability in the ping_check function that interpolates user-supplied monitor addresses directly into shell commands without validation. Authenticated users with monitor permissions can inject shell metacharacters via the /monitor/run_test/ endpoint to execute arbitrary commands as the Spug process user.

## What the upatch does

The BPF LSM program attaches to `lsm/bprm_check_security` and returns `-EPERM` when a Spug backend process (a Python or WSGI server process whose working directory is `spug_api`) attempts to execute a shell (`sh`, `dash`, or `bash`).

In Spug through 3.4.0, `ping_check()` passes `shell=True` to `subprocess.run()`, which executes `/bin/sh -c "ping -c 1 -W 3 ..."`. Refusing the shell execution makes `subprocess.run()` raise `PermissionError` before the shell or any injected command can run, and `ping_check()` catches the exception and returns a failure message. In Spug 4.0.0 and later, commit `97aebf133e1f` validates the host address with `is_valid_host()` and runs `['ping', '-c', '1', '-W', '3', addr]` without `shell=True`, executing `ping` directly without a shell.

The `refused` per-CPU array counts refused shell executions at key 0.

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

## Side effects

- Any ping monitor check (`type == '5'`) in an unpatched Spug through 3.4.0 fails with `PermissionError: [Errno 1] Operation not permitted: '/bin/sh'` because the unpatched `ping_check()` uses `shell=True`.
- Site checks (`site_check`), TCP port checks (`port_check`), and remote SSH checks (`host_executor`) continue to work, as they use Python sockets, `requests`, and Paramiko rather than a local shell.
- Patched Spug releases (4.0.0 and later) execute `ping` directly without `shell=True`, so ping checks work normally even with the upatch loaded.
- Other processes on the machine, including root shells and `sshd`, are unaffected because the program checks that the task's working directory is `spug_api` and its executable or command name is the Spug Python/WSGI server.

## Preemption model and cost

The program keeps no state beyond the `refused` per-CPU counter, which is updated with an atomic fetch-and-add (`__sync_fetch_and_add`), so it is safe under every kernel preemption model, including preemptible RCU, `PREEMPT_LAZY`, and `PREEMPT_RT`. It runs only on `execve` via `lsm/bprm_check_security`, checks the target binary's dentry name length and bytes first, and returns immediately for any executable other than `sh`, `dash`, or `bash`.

## Affected versions

| Software      | Affected      | Fixed in                      |
| ------------- | ------------- | ----------------------------- |
| openspug/spug | through 3.4.0 | 4.0.0 (commit `97aebf133e1f`) |

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

## How it was tested

On a vulnerable Spug 3.4.0 instance, the loaded upatch refused the /bin/sh execution triggered by ping_check on /monitor/test/ with EPERM, while the ping check succeeded before loading and after unloading.

- **Tested:** 25 Nov 2026
- **Target:** Spug 3.4.0 (spug_api) on Python 3.12, listening on 127.0.0.1:9001
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | POST /monitor/test/ (type 5, ping_check) spawns /bin/sh |
| --------------- | ------------------------------------------------------- |
| Before loading  | reached (Ping检测正常)                                      |
| Upatch loaded   | blocked (EPERM on /bin/sh)                              |
| After unloading | reached (Ping检测正常)                                      |

## 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-90770
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-90770-1.0.0.bee oci://<registry>/<namespace>/cve-2026-90770 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-90770-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-90770 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-90770)
- [VulnCheck advisory: Spug through 3.4.0 Remote Code Execution via ping_check](https://www.vulncheck.com/advisories/spug-through-3.4.0-remote-code-execution-via-ping-check)
- [GitHub issue #741](https://github.com/openspug/spug/issues/741)
- [Fix commit 97aebf133e1f](https://github.com/openspug/spug/commit/97aebf133e1f9cbb35ccebadab1faedfdfe93f42)
- [Vulnerable executors.py in v3.4.0](https://github.com/openspug/spug/blob/v3.4.0/spug_api/apps/monitor/executors.py)
- [Vulnerable views.py in v3.4.0](https://github.com/openspug/spug/blob/v3.4.0/spug_api/apps/monitor/views.py)

### Links

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

### More references from NVD (6)

- [github.com](https://github.com/openspug/spug)
- [github.com](https://github.com/openspug/spug/blob/v3.4.0/spug_api/apps/monitor/executors.py)
- [github.com](https://github.com/openspug/spug/blob/v3.4.0/spug_api/apps/monitor/views.py)
- [github.com](https://github.com/openspug/spug/commit/97aebf133e1f9cbb35ccebadab1faedfdfe93f42)
- [github.com](https://github.com/openspug/spug/issues/741)
- [vulncheck.com](https://www.vulncheck.com/advisories/spug-through-3.4.0-remote-code-execution-via-ping-check)
