# CVE-2026-82286: gpt-crawler Arbitrary File Write via outputFileName Parameter

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

## At a glance

CVE-2026-82286 is rated High 8.8 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/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 GPT Crawler (BuilderIO) and was published on 28 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-82286-write-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-82286 is an arbitrary file write and path traversal vulnerability in `@builder.io/gpt-crawler` through version 1.5.1. The Express API server in `src/server.ts` exposes an unauthenticated `POST /crawl` endpoint that validates the request body with `configSchema` in `src/config.ts` and runs `GPTCrawlerCore.crawl()` followed by `GPTCrawlerCore.write()`. In `src/core.ts`, `write()` constructs the output path from `config.outputFileName` as `${config.outputFileName.replace(/\.json$/, "")}-${fileCounter}.json` and passes it directly to `writeFile()` without path validation. By supplying an absolute path or `..` segments in `outputFileName`, a remote attacker can create or overwrite `*-<N>.json` files anywhere on the filesystem that the `node` process can write to.

### Official description

gpt-crawler through 1.5.1 fails to validate the outputFileName parameter in the POST /crawl endpoint, allowing unauthenticated attackers to write arbitrary files to any filesystem path. Attackers can supply absolute paths or parent-directory segments to overwrite existing files with content sourced from attacker-controlled URLs.

## What the upatch does

Two BPF LSM programs return `-EPERM` to processes whose executable is named `node` when they create or open for writing a `*-<N>.json` batch output file whose parent directory is not the process current working directory (`current->fs->pwd.dentry`):

| Hook               | Refused                                                                                                                            |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| `lsm/inode_create` | Creating a file ending in `-<digits>.json` outside the process working directory                                                   |
| `lsm/file_open`    | Opening for write (`FMODE_WRITE`, `O_CREAT`, or `O_TRUNC`) a file ending in `-<digits>.json` outside the process working directory |

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

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

## Side effects

- Any `POST /crawl` request whose `outputFileName` points outside the server's current working directory (via an absolute path or directory traversal segments) fails with HTTP 500 when `write()` attempts to write the batch file.
- Normal `POST /crawl` requests using a plain filename such as `output.json` continue to write `output-1.json` in the server's working directory and return the crawled JSON content.
- Crawlee dataset writes (`storage/datasets/default/000000001.json`) do not contain a `-<digits>.json` suffix and are unaffected.
- A `node` process cannot create or open for write files named `*-<digits>.json` outside its current working directory while the upatch is loaded.

## Preemption model and cost

The programs keep no shared state beyond the per-CPU refusal counter updated with an atomic fetch-and-add, so they are safe under every preemption model, including preemptible RCU and `PREEMPT_RT`. Every create or write open checks the dentry name length and suffix first before comparing the parent dentry with `current->fs->pwd.dentry` or checking the executable name.

## Affected versions

The vulnerability is in `@builder.io/gpt-crawler` through version 1.5.1 (unfixed upstream as of version 1.5.1). The upatch targets Linux kernels with BTF and BPF LSM enabled (such as Linux 7.4).

## How it was tested

On @builder.io/gpt-crawler 1.5.1, the loaded upatch refused output file writes outside the server working directory via outputFileName in POST /crawl (returning HTTP 500 and writing no file), while normal crawls writing output.json in the working directory succeeded.

- **Tested:** 25 Nov 2026
- **Target:** @builder.io/gpt-crawler 1.5.1 API server on Node.js 20.11.0, listening on 127.0.0.1:3000
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | POST /crawl writes \*-1.json outside working directory | Normal POST /crawl writes output-1.json in working directory |
| --------------- | ------------------------------------------------------ | ------------------------------------------------------------ |
| Before loading  | yes (HTTP 200)                                         | yes (HTTP 200)                                               |
| Upatch loaded   | no (HTTP 500)                                          | yes (HTTP 200)                                               |
| After unloading | yes (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-82286
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-82286-1.0.0.bee oci://<registry>/<namespace>/cve-2026-82286 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-82286-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-82286 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-82286)
- [GitHub Issue #418](https://github.com/BuilderIO/gpt-crawler/issues/418)
- [Vulnerable code in src/core.ts](https://github.com/BuilderIO/gpt-crawler/blob/d2245d66a5ad60bf227a55c849135394cbecc9b5/src/core.ts)
- [Vulnerable code in src/config.ts](https://github.com/BuilderIO/gpt-crawler/blob/d2245d66a5ad60bf227a55c849135394cbecc9b5/src/config.ts)
- [Vulnerable code in src/server.ts](https://github.com/BuilderIO/gpt-crawler/blob/d2245d66a5ad60bf227a55c849135394cbecc9b5/src/server.ts)
- [VulnCheck Advisory](https://www.vulncheck.com/advisories/gpt-crawler-arbitrary-file-write-via-outputfilename-parameter)

### Links

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

### More references from NVD (5)

- [github.com](https://github.com/BuilderIO/gpt-crawler)
- [github.com](https://github.com/BuilderIO/gpt-crawler/blob/d2245d66a5ad60bf227a55c849135394cbecc9b5/src/config.ts)
- [github.com](https://github.com/BuilderIO/gpt-crawler/blob/d2245d66a5ad60bf227a55c849135394cbecc9b5/src/core.ts)
- [github.com](https://github.com/BuilderIO/gpt-crawler/issues/418)
- [vulncheck.com](https://www.vulncheck.com/advisories/gpt-crawler-arbitrary-file-write-via-outputfilename-parameter)
