upatch.dev

CVE-2026-86806

opengeos GeoLibre _is_within_roots server-side request forgery

Refuses outbound TCP connections from geolibre-server to mitigate CVE-2026-86806.

Medium 6.9Vetted

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

At a glance

CVE-2026-86806 is a medium (CVSS 6.9) vulnerability in GeoLibre, published 8 September 2026. A vetted upatch, cve-2026-86806-postgis-block, blocks it on running Linux machines with shirudo until GeoLibre is upgraded.

Severity
Medium 6.9 CVSS 4.0
Chance of exploitation
0.6% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-918
Affected software
GeoLibre (opengeos)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-86806 describes a server-side request forgery (SSRF) vulnerability in the opengeos GeoLibre FastAPI sidecar (geolibre-server). The CVE record notes versions up to 2.3.0 and _is_within_roots (patched in commit b745f62e29fa37364686525a21eee5e5c0f8a369 for v2.4.0), while the linked issue #1573 and pull request #1571 detail the SSRF in backend/geolibre_server/geolibre_server/app/postgis.py: the /postgis/tables, /postgis/read and /postgis/write endpoints pass a caller-supplied PostgreSQL connection string directly to psycopg.connect() in _connect() without validating the destination host or port, allowing a remote caller to make the sidecar initiate TCP connections to arbitrary internal hosts or cloud metadata services. Pull request #1571 (merged as commit 28032d0084e408313da33861085737858ef7fb6b) fixes the PostGIS SSRF by disabling PostGIS connections unless GEOLIBRE_POSTGIS_HOSTS explicitly allowlists the destination hosts.

Official description

A weakness has been identified in opengeos GeoLibre up to 2.3.0. Impacted is the function _is_within_roots. This manipulation causes server-side request forgery. The attack can be initiated remotely. Upgrading to version 2.4.0 is recommended to address this issue. Patch name: b745f62e29fa37364686525a21eee5e5c0f8a369. It is recommended to upgrade the affected component.

Affected versions

opengeos GeoLibre:

Component Affected Fixed in
GeoLibre (geolibre-server) up to 2.3.0 (and 2.4.0 before PR #1571) 2.4.0 (b745f62e29fa) / PR #1571 (28032d0084e4)

Kernels: any Linux kernel supported by shirudo with BPF LSM enabled.

Sources

More references from NVD (9)

Mitigation

The BPF LSM program cve_2026_86806_connect attaches to lsm/socket_connect and returns -EPERM when a process with command name geolibre-server attempts an outbound SOCK_STREAM connection over AF_INET or AF_INET6:

Hook Refused
lsm/socket_connect Outbound IPv4 and IPv6 TCP connections from geolibre-server

The program checks the socket type (SOCK_STREAM) and address family (AF_INET or AF_INET6) before checking bpf_get_current_comm(), so non-TCP sockets and other processes return immediately. This enforces the same default-deny posture as the upstream fix when GEOLIBRE_POSTGIS_HOSTS is unset.

The refused per-CPU array counts refused connection attempts at key 0.

Side effects

  • Outbound TCP connections initiated by geolibre-server (such as PostGIS database connections via psycopg.connect()) fail with EPERM, causing /postgis/tables, /postgis/read and /postgis/write to return HTTP 400 (Could not connect to PostgreSQL: ... Operation not permitted).
  • Inbound HTTP requests to geolibre-server (such as /health, /algorithms and local processing endpoints) and Unix domain socket operations continue to work normally.
  • If geolibre-server is started under a different process command name (for example directly via python or uvicorn rather than the geolibre-server entrypoint), the command-name match does not fire.

Preemption model and cost

The program keeps no state beyond the per-CPU refusal counter, which it updates with __sync_fetch_and_add, making it safe under all preemption models including PREEMPT_LAZY and PREEMPT_RT. On every socket_connect call, it reads the socket type and address family and, for TCP sockets, checks the 16-byte task command name.

The policy

70 lines of BPF C, attached at lsm/socket_connect.

// 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 AF_INET		2
#define AF_INET6	10
#define SOCK_STREAM	1

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 comm_is_geolibre_server(void)
{
	const char want[] = "geolibre-server";
	char comm[16] = {};

	if (bpf_get_current_comm(comm, sizeof(comm)) < 0)
		return false;
	for (__u32 i = 0; i < sizeof(want); i++) {
		if (comm[i] != want[i])
			return false;
	}
	return true;
}

SEC("lsm/socket_connect")
int BPF_PROG(cve_2026_86806_connect, struct socket *sock,
	     struct sockaddr *address, int addrlen, int ret)
{
	unsigned short family;

	if (ret)
		return earlier_verdict(ret);
	if (!sock || !address)
		return 0;
	if (sock->type != SOCK_STREAM)
		return 0;
	family = address->sa_family;
	if (family != AF_INET && family != AF_INET6)
		return 0;
	if (!comm_is_geolibre_server())
		return 0;
	count_refused();
	return -EPERM;
}

Process

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

  1. 8 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #58 openedAdd CVE-2026-86806: Refuses outbound TCP connections from geolibre-serverromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026MergeMerged #58romanlab

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

Evidence

The /postgis/tables SSRF probe connected out from geolibre-server before and after the upatch, and was refused at socket_connect while the upatch was loaded.

Tested
25 Nov 2026
Target
opengeos GeoLibre 2.3.0 geolibre-server sidecar with psycopg PostGIS extra
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StatePostGIS SSRF outbound TCP connect blockedInbound HTTP request to geolibre-server works
Before loadingnoyes
Upatch loadedyesyes
After unloadingnoyes
tools-test.log Output of tools/test --setup showing the probe reached before, blocked while loaded, and reached after.
tools/test --setup, 2026-11-25T13:32:28Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-86806
  setup   done         GEOLIBRE_URL=http://127.0.0.1:8765
  before  reached      geolibre-server connected out to 127.0.0.1:34519 via /postgis/tables
  loaded  blocked      socket_connect refused outbound TCP connection from geolibre-server
  after   reached      geolibre-server connected out to 127.0.0.1:38005 via /postgis/tables
  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-86806
Publish and roll out
shirudo bpm push build/packages/cve-2026-86806-1.0.0.bee oci://<registry>/<namespace>/cve-2026-86806 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-86806-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>