Exploit database

GH-b72bf8a065b2fa376d029f4cedd11a24

r3n3r0/cve-2026-27280

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-27280

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files15
r3n3r0/cve-2026-27280Revision e25cb94988d6

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

06-rce-lab/src/probe_scudo_header.cpp

C++ · 3,443 bytes
// Where exactly does Scudo keep the metadata it validates on free()?
//
// Empirical, no assumptions: corrupt one 4-byte word at a time at a given
// offset relative to a chunk payload, free everything, and see whether the
// allocator aborts.  Offsets that abort ARE metadata; offsets that survive are
// safe to write through.  Each probe runs in its own forked child.
//
// Also dumps the raw bytes around a chunk so the header can be eyeballed.

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <unistd.h>
#include <sys/wait.h>
#include <algorithm>
#include <vector>

static uint32_t writable_pattern (int byteval)
	{
	float f = (1.0f / 255.0f) * (float) byteval;
	uint32_t u; memcpy (&u, &f, 4); return u;
	}

static size_t measure_block_size (size_t req, int n = 256)
	{
	std::vector<uintptr_t> v;
	for (int i = 0; i < n; i++)
		{ void *p = malloc (req); if (!p) break; v.push_back ((uintptr_t) p); }
	std::sort (v.begin (), v.end ());
	size_t best = 0;
	for (size_t i = 1; i < v.size (); i++)
		{ size_t d = v[i] - v[i-1]; if (d && (!best || d < best)) best = d; }
	for (uintptr_t a : v) free ((void *) a);
	return best;
	}

// corrupt the word at payload+off (off may be negative) of every chunk, then free
// returns 0 survived, 1 aborted
static int probe_offset (size_t req, long off, int nchunk)
	{
	pid_t pid = fork ();
	if (pid < 0) return -1;
	if (pid == 0)
		{
		std::vector<uintptr_t> v;
		for (int i = 0; i < nchunk; i++)
			{ void *p = malloc (req); if (!p) break;
			  memset (p, 0x41, req); v.push_back ((uintptr_t) p); }

		uint32_t pat = writable_pattern (255);
		for (uintptr_t a : v)
			*(uint32_t *) ((char *) a + off) = pat;

		for (uintptr_t a : v) free ((void *) a);
		for (int i = 0; i < 1024; i++) { void *p = malloc (req); free (p); }
		_exit (0);
		}
	int st = 0; waitpid (pid, &st, 0);
	return (WIFEXITED (st) && WEXITSTATUS (st) == 0) ? 0 : 1;
	}

static void dump_around (size_t req)
	{
	// allocate a few and dump the 32 bytes before and 16 after the payload
	void *a = malloc (req); void *b = malloc (req);
	memset (a, 0xAA, req); memset (b, 0xBB, req);
	printf ("  chunk A payload=%p   chunk B payload=%p   delta=%ld\n",
			a, b, (long) ((uintptr_t) b - (uintptr_t) a));
	for (int who = 0; who < 2; who++)
		{
		unsigned char *p = (unsigned char *) (who ? b : a);
		printf ("   %c: ", who ? 'B' : 'A');
		for (int d = -16; d < 8; d++)
			{
			if (d == 0) printf ("| ");
			printf ("%02x ", p[d]);
			}
		printf ("\n");
		}
	free (a); free (b);
	}

int main (int argc, char **argv)
	{
	size_t req = (argc > 1) ? (size_t) atoi (argv[1]) : 16;
	size_t block = measure_block_size (req);
	printf ("=== Scudo metadata probe: malloc(%zu), block %zu ===\n\n", req, block);

	printf ("--- raw bytes around a live chunk (payload marked with |) ---\n");
	dump_around (req);

	printf ("\n--- which offsets abort on free? (4-byte write, %d chunks) ---\n",
			512);
	printf ("    offsets are relative to the PAYLOAD pointer\n\n");

	long lo = -(long) block;
	long hi = (long) block;
	for (long off = lo; off + 4 <= hi; off += 4)
		{
		int r = probe_offset (req, off, 512);
		const char *tag = "";
		if (off < 0)						tag = "(before payload)";
		else if (off + 4 <= (long) req)		tag = "(inside requested size)";
		else								tag = "(payload tail / next block)";
		printf ("  off %+4ld : %-9s %s\n", off,
				r < 0 ? "FORK-FAIL" : (r ? "ABORTS" : "survives"), tag);
		}
	return 0;
	}