upatch.dev

CVE-2026-87821

Lara Dashboard 0.9.2 through 1.3.1 Server-Side Request Forgery in Builder Markdown Fetch

Refuses outbound connections from php processes to internal and metadata addresses to mitigate CVE-2026-87821.

High 7.1Vetted

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-87821 is a high (CVSS 7.1) vulnerability in Lara Dashboard, published 9 September 2026. A vetted upatch, cve-2026-87821-ssrf-block, blocks it on running Linux machines with shirudo until Lara Dashboard is upgraded.

Severity
High 7.1 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-918
Affected software
Lara Dashboard (laradashboard)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-87821 (GHSA-4xqv-4c27-6c4j), published on 9 September 2026, is a Server-Side Request Forgery vulnerability in Lara Dashboard versions 0.9.2 through 1.3.1. In App\Http\Controllers\Api\Builder\MarkdownController::fetch(), the POST /api/admin/builder/markdown/fetch route accepts an arbitrary URL from any authenticated user (including low-privilege Subscriber accounts) and passes it to App\Services\Builder\MarkdownFetchService::fetchAndConvert(). That service validates only that the input is a syntactically valid URL (filter_var($url, FILTER_VALIDATE_URL)) before issuing an HTTP GET request with Http::timeout(30)->get($rawUrl) and returning the converted response body in the JSON reply. Because there is no host allow-list, private/reserved IP check or redirect restriction prior to 1.3.2, an authenticated user can make the server fetch internal HTTP services, probe internal ports, or read cloud instance metadata endpoints such as 169.254.169.254.

Official description

Lara Dashboard through 1.3.1 contains a server-side request forgery vulnerability in the POST /api/admin/builder/markdown/fetch endpoint that allows any authenticated user to fetch arbitrary URLs and read the response body. Attackers can read internal HTTP services and cloud metadata including IAM credentials by supplying malicious URLs without host validation or redirect restrictions.

Affected versions

Lara Dashboard versions 0.9.2 through 1.3.1 are affected; version 1.3.2 fixes the vulnerability in commit 738cc1a219ce459323ef1d09c3789075f1b8d2f2 by introducing App\Support\Security\SafeUrlValidator and disabling HTTP redirects.

The upatch uses the socket_connect and socket_sendmsg LSM hooks, which are present on all Linux kernels that support shirudo.

Sources

More references from NVD (10)

Mitigation

Two BPF LSM programs attach to lsm/socket_connect and lsm/socket_sendmsg and return -EPERM when a PHP process (php, php-fpm*, php-cgi* or php8.*, matched by task comm or executable dentry name) attempts to connect or send to an internal or metadata IPv4 or IPv6 address:

Hook Refused
lsm/socket_connect Connecting an AF_INET or AF_INET6 socket from a PHP process to a loopback, RFC 1918 private, RFC 6598 CGNAT, link-local (169.254.0.0/16, fe80::/10) or IPv6 unique-local (fc00::/7) address on any port other than 3306, 5432 or 6379
lsm/socket_sendmsg Sending a message with an explicit destination address (msg_name) from a PHP process to those same internal and metadata address ranges and ports

Connections to standard database and cache ports (3306 for MySQL, 5432 for PostgreSQL, 6379 for Redis) are permitted so Lara Dashboard's configured database and Redis connections continue to work on localhost or a private network, while outbound HTTP fetches to internal services and cloud metadata fail immediately in the kernel. Public internet connections (such as fetching markdown from raw.githubusercontent.com, gitlab.com or bitbucket.org, the hosts SafeUrlValidator allows in 1.3.2) are unaffected.

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

Side effects

  • Outbound connections from PHP processes to loopback (127.0.0.0/8, ::1), unspecified (0.0.0.0/8, ::), RFC 1918 private (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), CGNAT (100.64.0.0/10), link-local (169.254.0.0/16, fe80::/10) and IPv6 ULA (fc00::/7) addresses on ports other than 3306, 5432 and 6379 fail with EPERM.
  • In Lara Dashboard, POST /api/admin/builder/markdown/fetch returns HTTP 422 (Failed to fetch content: cURL error 7) when given an internal or metadata URL, while normal dashboard operations and markdown fetches from public hosts continue to work.
  • If a PHP application on the same host connects to a local HTTP service (such as a local Ollama, Meilisearch or SMTP server on a non-standard port) over TCP, those connections will also be refused while the upatch is loaded.

Preemption model and cost

The programs keep no state beyond the refused per-CPU counter, which is updated with __sync_fetch_and_add, making them safe under every preemption model including preemptible RCU and PREEMPT_RT. On every socket_connect and unconnected socket_sendmsg, the program checks the address family and destination IP range first before inspecting the current task's command or executable name, so Unix domain sockets and connections to public IP addresses return after a few integer comparisons.

The policy

192 lines of BPF C, attached at lsm/socket_connect and lsm/socket_sendmsg.

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

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

#define EPERM		1
#define AF_UNSPEC	0
#define AF_INET		2
#define AF_INET6	10

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 is_php_name(const char *buf, __u32 len)
{
	if (len < 3)
		return false;
	if (buf[0] != 'p' || buf[1] != 'h' || buf[2] != 'p')
		return false;
	if (len == 3)
		return true;
	return buf[3] == '-' || buf[3] == '.' ||
	       (buf[3] >= '0' && buf[3] <= '9');
}

static __always_inline bool current_is_php(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe;
	const unsigned char *name;
	char comm[16] = {};
	char buf[16] = {};
	__u32 len;

	if (!bpf_get_current_comm(comm, sizeof(comm))) {
		if (comm[0] == 'p' && comm[1] == 'h' && comm[2] == 'p' &&
		    (comm[3] == 0 || comm[3] == '-' || comm[3] == '.' ||
		     (comm[3] >= '0' && comm[3] <= '9')))
			return true;
	}
	exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	if (!exe)
		return false;
	len = BPF_CORE_READ(exe, d_name.len);
	name = BPF_CORE_READ(exe, d_name.name);
	if (!name || len < 3)
		return false;
	if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
		return false;
	return is_php_name(buf, len);
}

static __always_inline bool is_db_port(__u16 port)
{
	return port == 3306 || port == 5432 || port == 6379;
}

static __always_inline bool ipv4_is_internal(__u32 ip)
{
	if ((ip & 0xff000000u) == 0x00000000u)
		return true;
	if ((ip & 0xff000000u) == 0x7f000000u)
		return true;
	if ((ip & 0xff000000u) == 0x0a000000u)
		return true;
	if ((ip & 0xfff00000u) == 0xac100000u)
		return true;
	if ((ip & 0xffff0000u) == 0xc0a80000u)
		return true;
	if ((ip & 0xffff0000u) == 0xa9fe0000u)
		return true;
	if ((ip & 0xffc00000u) == 0x64400000u)
		return true;
	return false;
}

static __always_inline bool ipv6_is_internal(const struct in6_addr *addr6)
{
	__u32 w0 = bpf_ntohl(addr6->in6_u.u6_addr32[0]);
	__u32 w1 = bpf_ntohl(addr6->in6_u.u6_addr32[1]);
	__u32 w2 = bpf_ntohl(addr6->in6_u.u6_addr32[2]);
	__u32 w3 = bpf_ntohl(addr6->in6_u.u6_addr32[3]);

	if (w0 == 0 && w1 == 0 && w2 == 0 && (w3 == 0 || w3 == 1))
		return true;
	if (w0 == 0 && w1 == 0 && w2 == 0x0000ffffu)
		return ipv4_is_internal(w3);
	if ((w0 & 0xfe000000u) == 0xfc000000u)
		return true;
	if ((w0 & 0xffc00000u) == 0xfe800000u)
		return true;
	return false;
}

static __always_inline bool peer_is_blocked(__u16 family,
					    const struct sockaddr *address,
					    int addrlen)
{
	if (family == AF_INET) {
		struct sockaddr_in sin = {};

		if (addrlen < (int)sizeof(sin) ||
		    bpf_probe_read_kernel(&sin, sizeof(sin), address))
			return false;
		if (is_db_port(bpf_ntohs(sin.sin_port)))
			return false;
		return ipv4_is_internal(bpf_ntohl(sin.sin_addr.s_addr));
	}
	if (family == AF_INET6) {
		struct sockaddr_in6 sin6 = {};

		if (addrlen < (int)sizeof(sin6) ||
		    bpf_probe_read_kernel(&sin6, sizeof(sin6), address))
			return false;
		if (is_db_port(bpf_ntohs(sin6.sin6_port)))
			return false;
		return ipv6_is_internal(&sin6.sin6_addr);
	}
	return false;
}

SEC("lsm/socket_connect")
int BPF_PROG(cve_2026_87821_connect, struct socket *sock,
	     struct sockaddr *address, int addrlen, int ret)
{
	__u16 family = 0;

	if (ret)
		return earlier_verdict(ret);
	if (!address || addrlen < (int)sizeof(family) ||
	    bpf_probe_read_kernel(&family, sizeof(family), &address->sa_family))
		return 0;
	if (family != AF_INET && family != AF_INET6)
		return 0;
	if (!peer_is_blocked(family, address, addrlen) || !current_is_php())
		return 0;
	count_refused();
	return -EPERM;
}

SEC("lsm/socket_sendmsg")
int BPF_PROG(cve_2026_87821_sendmsg, struct socket *sock, struct msghdr *msg,
	     int size, int ret)
{
	struct sockaddr *address;
	struct sock *sk;
	__u16 family = 0;
	int addrlen;

	if (ret)
		return earlier_verdict(ret);
	address = msg->msg_name;
	if (!address)
		return 0;
	addrlen = msg->msg_namelen;
	if (addrlen < (int)sizeof(family) ||
	    bpf_probe_read_kernel(&family, sizeof(family), &address->sa_family))
		return 0;
	sk = sock->sk;
	if (family == AF_UNSPEC && sk && sk->__sk_common.skc_family == AF_INET)
		family = AF_INET;
	if (family != AF_INET && family != AF_INET6)
		return 0;
	if (!peer_is_blocked(family, address, addrlen) || !current_is_php())
		return 0;
	count_refused();
	return -EPERM;
}

Process

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

  1. 9 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #95 openedAdd CVE-2026-87821: Refuses outbound connections from php processes to internal and metadataromanlab
  3. 25 Nov 2026CICheck entriespassed
  4. 25 Nov 2026CIingestpassed
  5. 25 Nov 2026CICompile with clang 23passed
  6. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
  7. 25 Nov 2026MergeMerged #95romanlab

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

Evidence

On a vulnerable Lara Dashboard 1.3.1 instance, the loaded upatch refused the server-side markdown fetch to an internal loopback HTTP listener while normal login and API requests kept working.

Tested
25 Nov 2026
Target
Lara Dashboard 1.3.1 on PHP 8.3.13, SQLite, loopback only
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Machine
shirudo test VM
Distribution
Ubuntu 26.04
Results
StatePOST /api/admin/builder/markdown/fetch to internal 127.0.0.1 listener
Before loadingreached (HTTP 200, body disclosed)
Upatch loadedblocked (HTTP 422, connect refused in kernel)
After unloadingreached (HTTP 200, body disclosed)
tools-test.log Output of tools/test --setup showing the payload reaching the internal listener before and after, and being blocked while the upatch was loaded.
tools/test --setup, 2026-11-25T16:01:35Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-87821
  setup   done         LARADASHBOARD_URL=http://127.0.0.1:18080 LARADASHBOARD_EMAIL=subscriber@example.com LARADASHBOARD_PASSWORD=password
  before  reached      Lara Dashboard fetched internal URL http://127.0.0.1:43935/probe.md and disclosed its body (HTTP 200)
  loaded  blocked      internal markdown fetch to http://127.0.0.1:43515/probe.md was refused in the kernel (Failed to fetch content: cURL error 7: Failed to connect to 127.0.0.1 port 43515 after 0 ms: Could not connect to server (see https://curl.se/libcurl/c/libcurl-errors.html) for http://127.0.0.1:43515/probe.md)
  after   reached      Lara Dashboard fetched internal URL http://127.0.0.1:41135/probe.md and disclosed its body (HTTP 200)
  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-87821
Publish and roll out
shirudo bpm push build/packages/cve-2026-87821-1.0.0.bee oci://<registry>/<namespace>/cve-2026-87821 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-87821-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>