# CVE-2026-86806: opengeos GeoLibre \_is_within_roots server-side request forgery

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

## At a glance

CVE-2026-86806 is rated Medium 6.9 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/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 GeoLibre (opengeos) and was published on 8 Sept 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-86806-postgis-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-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.

## What the upatch does

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.

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

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

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

## How it was tested

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

| State           | PostGIS SSRF outbound TCP connect blocked | Inbound HTTP request to geolibre-server works |
| --------------- | ----------------------------------------- | --------------------------------------------- |
| Before loading  | no                                        | yes                                           |
| Upatch loaded   | yes                                       | yes                                           |
| After unloading | no                                        | 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-86806
```

Publish and roll out:

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

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-86806 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-86806)
- [GitHub Issue #1573](https://github.com/opengeos/GeoLibre/issues/1573)
- [GitHub Pull Request #1571](https://github.com/opengeos/GeoLibre/pull/1571) and merge commit [28032d0084e4](https://github.com/opengeos/GeoLibre/commit/28032d0084e408313da33861085737858ef7fb6b)
- [Fix commit b745f62e29fa](https://github.com/opengeos/GeoLibre/commit/b745f62e29fa37364686525a21eee5e5c0f8a369) and [Release v2.4.0](https://github.com/opengeos/GeoLibre/releases/tag/v2.4.0)

### Links

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

### More references from NVD (9)

- [github.com](https://github.com/opengeos/GeoLibre/)
- [github.com](https://github.com/opengeos/GeoLibre/commit/b745f62e29fa37364686525a21eee5e5c0f8a369)
- [github.com](https://github.com/opengeos/GeoLibre/issues/1573)
- [github.com](https://github.com/opengeos/GeoLibre/pull/1571)
- [github.com](https://github.com/opengeos/GeoLibre/releases/tag/v2.4.0)
- [vuldb.com](https://vuldb.com/cve/CVE-2026-86806)
- [vuldb.com](https://vuldb.com/submit/911055)
- [vuldb.com](https://vuldb.com/vuln/399812)
- [vuldb.com](https://vuldb.com/vuln/399812/cti)
