# CVE-2026-77621: Vector: Arbitrary file write in the file sink via templated path (path traversal).

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

## At a glance

CVE-2026-77621 is rated Critical 9.3 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:H/SI:H/SA:H/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 Vector (vectordotdev) and was published on 22 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 1.1%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-77621-vector-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-77621 (GHSA-6342-xwvw-c637), published on 22 September 2026, is a path traversal vulnerability in the `file` sink of Vector from version 0.10.0 before 0.57.0. When a `file` sink `path` template references an event field (for example `/var/log/vector/{{ service }}.log`), `FileSink` renders the template from incoming event data and passes the resulting path to `open_file`, which creates missing parent directories with `fs::create_dir_all` and opens the file for writing without checking that the resolved path stays inside the intended directory. An untrusted event source supplying `../` segments or an absolute path in the templated field causes Vector to create directories and create or overwrite arbitrary files on the filesystem with the privileges of the `vector` process.

### Official description

Vector is a high-performance observability data pipeline. From 0.10.0 until 0.57.0, the file sink renders its templated path from event fields and opens the result without confining it to an intended directory. When an untrusted source supplies an event field used by the path template, the value can contain an absolute path or parent-directory traversal, causing Vector to create parent directories and create or overwrite files outside the intended location with the Vector process privileges. The resulting file write can modify sensitive files and can lead to code execution when a scheduled task, authorization file, or subsequently executed script is targeted. This issue is fixed in version 0.57.0.

## What the upatch does

Three BPF LSM programs return `-EPERM` when a process whose executable is named `vector` attempts to create directories, create files or open regular files for writing outside `/var/log/vector` and `/var/lib/vector`:

| Hook               | Refused                                                                                                           |
| ------------------ | ----------------------------------------------------------------------------------------------------------------- |
| `lsm/inode_create` | Creating a new file whose parent dentry is not under `/var/log/vector` or `/var/lib/vector`                       |
| `lsm/inode_mkdir`  | Creating a directory that is neither `/var/log/vector` nor `/var/lib/vector` nor inside either directory          |
| `lsm/file_open`    | Opening a regular file with `FMODE_WRITE` whose parent dentry is not under `/var/log/vector` or `/var/lib/vector` |

Because the kernel resolves `..` components and symlinks during VFS path lookup before calling `security_inode_create`, `security_inode_mkdir` and `security_file_open`, the dentry hierarchy passed to these hooks reflects the resolved target location. Any path that traverses out of `/var/log/vector` or `/var/lib/vector` has a parent dentry outside those subtrees and is refused.

The `refused` per-CPU array counts refusals: key 0 for file creates, key 1 for directory creates and key 2 for write-mode opens.

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

## Side effects

- Vector can create directories and write or create regular files only inside `/var/log/vector` and `/var/lib/vector` (to a directory nesting depth of 16 levels below either base directory). A `file` sink or `data_dir` configured to write outside those two directories will fail with `Permission denied` (`EPERM`).
- Reading files, opening sockets, pipes and character devices (such as `/dev/null` or stdout/stderr) and writing inside `/var/log/vector` and `/var/lib/vector` continue to work.
- Not covered: traversal from one subdirectory of `/var/log/vector` into another subdirectory of `/var/log/vector` (or `/var/lib/vector`), or a Vector binary renamed to something other than `vector`.

## Preemption model and cost

The programs keep no shared state beyond the per-CPU `refused` counter, updated with an atomic fetch-and-add, so they are safe under every preemption model including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC` and `PREEMPT_RT`. On `file_open`, read-only opens and non-regular files return after checking `file->f_mode` and `i_mode`. On `inode_create`, `inode_mkdir` and write-mode regular file opens, non-Vector processes return immediately after checking the current task's executable dentry name (`vector`).

## Affected versions

Vector versions 0.10.0 to 0.56.0 are affected; 0.57.0 fixes the issue by introducing `PathConfinement` and `base_dir` enforcement.

Kernels: the `inode_create` and `inode_mkdir` programs use the LSM hook prototypes that take `const struct mnt_idmap *idmap` as their first argument, matching Linux 6.3 and later (including Linux 7.4).

## How it was tested

On Vector 0.56.0 with a templated file sink path, the loaded upatch refused a path traversal write outside /var/log/vector (HTTP 500) while allowing normal writes inside /var/log/vector.

- **Tested:** 25 Nov 2026
- **Target:** Vector 0.56.0 with an http_server source on 127.0.0.1:8686 and a file sink using templated path /var/log/vector/{{ service }}.log
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | Traversal write outside /var/log/vector blocked | Confined write inside /var/log/vector works |
| --------------- | ----------------------------------------------- | ------------------------------------------- |
| Before loading  | no (HTTP 200)                                   | yes                                         |
| Upatch loaded   | yes (HTTP 500)                                  | yes                                         |
| After unloading | no (HTTP 200)                                   | yes                                         |

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

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-77621-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77621 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77621-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-77621 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-77621)
- [GitHub Security Advisory GHSA-6342-xwvw-c637](https://github.com/vectordotdev/vector/security/advisories/GHSA-6342-xwvw-c637)
- Fix commits: [6951064ed1d2](https://github.com/vectordotdev/vector/commit/6951064ed1d295fbff67a5ba7da5971fc6f58c46), [8832452f57af](https://github.com/vectordotdev/vector/commit/8832452f57afb536ea0de53a093f9fd1b669ccec)
- [Vector v0.57.0 release](https://github.com/vectordotdev/vector/releases/tag/v0.57.0)

### Links

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

### More references from NVD (6)

- [github.com](https://github.com/vectordotdev/vector/commit/6951064ed1d295fbff67a5ba7da5971fc6f58c46)
- [github.com](https://github.com/vectordotdev/vector/commit/8832452f57afb536ea0de53a093f9fd1b669ccec)
- [github.com](https://github.com/vectordotdev/vector/pull/25820)
- [github.com](https://github.com/vectordotdev/vector/pull/25830)
- [github.com](https://github.com/vectordotdev/vector/releases/tag/v0.57.0)
- [github.com](https://github.com/vectordotdev/vector/security/advisories/GHSA-6342-xwvw-c637)
