upatch.dev

CVE-2026-82286

gpt-crawler Arbitrary File Write via outputFileName Parameter

Refuses gpt-crawler output file writes outside its working directory to mitigate CVE-2026-82286.

High 8.8Vetted

EPSS 0.5%: the estimated chance this CVE is exploited in the next 30 days, as of 25 Nov 2026.

At a glance

CVE-2026-82286 is a high (CVSS 8.8) vulnerability in GPT Crawler, published 28 August 2026. A vetted upatch, cve-2026-82286-write-block, blocks it on running Linux machines with shirudo until GPT Crawler is upgraded.

Severity
High 8.8 CVSS 4.0
Chance of exploitation
0.5% in the next 30 days (EPSS, 25 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-22
Affected software
GPT Crawler (BuilderIO)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

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.

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).

Sources

More references from NVD (5)

Mitigation

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.

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.

The policy

137 lines of BPF C, attached at lsm/inode_create and lsm/file_open.

// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_core_read.h>

#define EPERM 1
#define FMODE_WRITE 0x2
#define O_CREAT 0100
#define O_TRUNC 01000

char _license[] SEC("license") = "Dual BSD/GPL";

struct {
	__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
	__uint(max_entries, 1);
	__type(key, __u32);
	__type(value, __u64);
} refused SEC(".maps");

static __always_inline void count_refused(void)
{
	__u32 key = 0;
	__u64 *value = bpf_map_lookup_elem(&refused, &key);

	if (value)
		__sync_fetch_and_add(value, 1);
}

static __always_inline int earlier_verdict(int ret)
{
	return ret >= -4095 && ret < 0 ? ret : -EPERM;
}

static __always_inline bool name_is_node(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	char buf[5] = {};

	if (!dentry || BPF_CORE_READ(dentry, d_name.len) != 4)
		return false;
	if (bpf_probe_read_kernel(buf, 4, name))
		return false;
	return buf[0] == 'n' && buf[1] == 'o' && buf[2] == 'd' && buf[3] == 'e';
}

static __always_inline bool current_is_node(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);

	return name_is_node(exe);
}

static __always_inline bool ends_with_dash_num_json(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	__u32 len = BPF_CORE_READ(dentry, d_name.len);
	char tail[16] = {};
	__u32 copy_len;
	__u32 off;

	if (!name || len < 7 || len > 255)
		return false;
	copy_len = len < 16 ? len : 16;
	off = len - copy_len;
	if (bpf_probe_read_kernel(tail, sizeof(tail), name + off))
		return false;
	if (tail[copy_len - 5] != '.' || tail[copy_len - 4] != 'j' ||
	    tail[copy_len - 3] != 's' || tail[copy_len - 2] != 'o' ||
	    tail[copy_len - 1] != 'n')
		return false;
	if (tail[copy_len - 6] < '0' || tail[copy_len - 6] > '9')
		return false;

	#pragma unroll
	for (int k = 7; k <= 15; k++) {
		if (copy_len >= (__u32)k) {
			char c = tail[copy_len - k];
			if (c == '-')
				return true;
			if (c < '0' || c > '9')
				return false;
		}
	}
	return false;
}

static __always_inline bool check_outside_cwd(const struct dentry *parent)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *cwd = BPF_CORE_READ(task, fs, pwd.dentry);

	return parent && cwd && parent != cwd;
}

SEC("lsm/inode_create")
int BPF_PROG(cve_2026_82286_create, const struct mnt_idmap *idmap,
	     struct inode *dir, struct dentry *dentry, umode_t mode, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!ends_with_dash_num_json(dentry))
		return 0;
	if (!check_outside_cwd(BPF_CORE_READ(dentry, d_parent)))
		return 0;
	if (!current_is_node())
		return 0;
	count_refused();
	return -EPERM;
}

SEC("lsm/file_open")
int BPF_PROG(cve_2026_82286_open, struct file *file, int ret)
{
	const struct dentry *dentry;
	unsigned int flags;
	fmode_t mode;

	if (ret)
		return earlier_verdict(ret);
	mode = BPF_CORE_READ(file, f_mode);
	flags = BPF_CORE_READ(file, f_flags);
	if (!(mode & FMODE_WRITE) && !(flags & (O_CREAT | O_TRUNC)))
		return 0;
	dentry = BPF_CORE_READ(file, f_path.dentry);
	if (!ends_with_dash_num_json(dentry))
		return 0;
	if (!check_outside_cwd(BPF_CORE_READ(dentry, d_parent)))
		return 0;
	if (!current_is_node())
		return 0;
	count_refused();
	return -EPERM;
}

Process

How this upatch was written, checked and reviewed, from the registry’s history.

  1. 28 Aug 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #88 openedAdd CVE-2026-82286: Refuses gpt-crawler output file writes outside its working directoryromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026MergeMerged #88romanlab

No human review is recorded on GitHub for this upatch yet.

Evidence

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
StatePOST /crawl writes *-1.json outside working directoryNormal POST /crawl writes output-1.json in working directory
Before loadingyes (HTTP 200)yes (HTTP 200)
Upatch loadedno (HTTP 500)yes (HTTP 200)
After unloadingyes (HTTP 200)yes (HTTP 200)
tools-test.log Output of tools/test --setup showing reached before, blocked while loaded, and reached again after.
tools/test --setup, 2026-11-25T15:23:48Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-82286
  setup   done         GPT_CRAWLER_URL=http://127.0.0.1:3000 GPT_CRAWLER_OUTSIDE=/opt/upatch-payload/cve-2026-82286/outside
  before  reached      POST /crawl wrote upatch-probe-51a74b894e52-1.json outside working directory (HTTP 200); removed it
  loaded  blocked      POST /crawl outside working directory failed with HTTP 500 and wrote no file
  after   reached      POST /crawl wrote upatch-probe-1c2323256ca7-1.json outside working directory (HTTP 200); removed it
  PASS: reached before, blocked while loaded, reached again after

Use it

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
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
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>