# CVE-2026-78381: RansomLook Arbitrary File Read via Path Traversal in Post screen Field

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

## At a glance

CVE-2026-78381 is rated High 8.2 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:H/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 RansomLook (ransomlook) and was published on 24 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.6%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-78381-screen-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-78381 was published on 24 August 2026. In RansomLook through 2.0.0, the `GroupPost.get` API handler (`GET /api/post/<name>/<postname>` in `website/web/api/genericapi.py`) concatenates the database-controlled `post["screen"]` value directly with `str(get_homedir()) + "/source/"` and opens the resulting path without checking that the resolved target stays inside `source/`. Because the `screen` field is free-form and can be set through the administrative post editor or imported verbatim from a remote RansomLook instance by `tools/import_from_instance.py`, a traversal sequence such as `../config/generic.json` causes `GroupPost.get` to read arbitrary files outside `source/` and return their contents base64-encoded in the API response.

### Official description

RansomLook contains a path traversal vulnerability in the handling of the screen field associated with group posts. The GroupPost.get API handler concatenates the database-controlled screen value directly with the application's source/ directory and opens the resulting path without verifying that the resolved file remains within the intended directory.

Because the screen field is free-form and can be populated either through the administrative post editor or through data imported from a remote RansomLook instance, a malicious upstream instance can provide traversal sequences such as ../config/generic.json. When the affected post is subsequently retrieved through the API, RansomLook resolves and reads the attacker-controlled path and returns the contents of the referenced file Base64-encoded in the API response.

This can allow an attacker (being admin) controlling imported post data to read arbitrary files accessible to the RansomLook process, potentially exposing sensitive configuration data, API credentials, password hashes, or other application secrets. The attack does not require the malicious upstream to possess an account on the affected RansomLook instance.

The vulnerability is addressed by resolving screen paths with os.path.realpath() and verifying that the resolved path remains beneath the application's source/ directory. Validation is performed both when values are written and immediately before files are read. Using canonical paths also prevents traversal through symbolic links that would bypass purely lexical path normalization checks.

## What the upatch does

The `lsm/file_open` program matches processes whose executable name starts with `python` and whose working directory is named `website` (how `bin/start_website.py` starts Gunicorn for the `web:app` Flask application). When such a process opens a regular file whose dentry has the parent of `website` (the RansomLook home directory) as an ancestor within 8 directory levels without passing through `source`, `website` or `ransomlook`, the program returns `-EPERM`. A refusal from an earlier BPF LSM program on the same hook is passed on unchanged.

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

## Side effects

- While the upatch is loaded, a `GroupPost.get` request for a post whose `screen` field traverses out of `source/` into the RansomLook home directory (such as `../config/generic.json`) fails with `PermissionError` (`EPERM`), which Flask returns as HTTP 500 instead of disclosing the file.
- Reading configuration files under `config/` or `secret_key` after startup from the running `website` worker processes is refused with `EPERM`; `start_website` loads configuration and `secret_key` at worker import time before requests are served.
- Posts whose `screen` field names a file inside `source/` (such as `screenshots/<group>/<file>.png`) and normal API endpoints continue to work.
- Other processes on the machine are unaffected.

## Preemption model and cost

The program keeps no state: no maps, no shared or per-CPU data. It is correct under every preemption model, including preemptible RCU and `PREEMPT_RT`. On every `file_open` call by a non-Python process, or by a Python process whose working directory is not `website`, the program exits after checking the executable name and current working directory dentry name. Only regular file opens by the RansomLook website workers walk up to 8 parent dentries.

## Affected versions

This is an application vulnerability in RansomLook:

| Software   | Affected        | Fixed in                                                  |
| ---------- | --------------- | --------------------------------------------------------- |
| RansomLook | 0 through 2.0.0 | 2.1.0 (commit `274faccf65898e88ef54f35f304e0821a852a0b8`) |

The upatch uses the standard `lsm/file_open` hook and CO-RE reads against `vmlinux.h`, so it runs on any Linux kernel with BPF LSM and BTF support.

## How it was tested

On RansomLook 2.0.0, the loaded upatch refused opening ../config/generic.json through GroupPost.get while normal post screenshot retrieval inside source/ continued to work.

- **Tested:** 25 Nov 2026
- **Target:** RansomLook 2.0.0 website API (GroupPost.get on /api/post/\<name>/\<postname>), loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Machine:** shirudo test VM

### Results

| State           | Traversal screen (../config/generic.json) blocked | Normal screen inside source/ works |
| --------------- | ------------------------------------------------- | ---------------------------------- |
| Before loading  | no (HTTP 200)                                     | yes (HTTP 200)                     |
| Upatch loaded   | yes (HTTP 500)                                    | yes (HTTP 200)                     |
| After unloading | no (HTTP 200)                                     | yes (HTTP 200)                     |

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

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-78381-1.0.0.bee oci://<registry>/<namespace>/cve-2026-78381 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-78381-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-78381 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-78381)
- [Fix commit 274faccf6589](https://github.com/RansomLook/RansomLook/commit/274faccf65898e88ef54f35f304e0821a852a0b8)
- [RansomLook releases](https://github.com/RansomLook/RansomLook/releases)

### Links

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

### More references from NVD (1)

- [github.com](https://github.com/RansomLook/RansomLook/commit/274faccf65898e88ef54f35f304e0821a852a0b8)
