Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
CriticalPublic exploit

Heap buffer overflow in MariaDB JSON_SCHEMA_VALID()

IdentifiersCVE-2026-32710CWE-122· Heap-based Buffer Overflow

CVE-2026-32710 is a heap-based buffer overflow in MariaDB Server’s JSON schema validation logic reachable via the JSON_SCHEMA_VALID() function. The provided content identifies the vulnerable code path as json_get_normalized_string in sql/json_schema_helper.cc. In the affected implementation, a local DYNAMIC_STRING is initialized with init_dynamic_string(&a_res, NULL, 0, 0), resulting in a default buffer capacity of 128 bytes. When processing JSON string values, the code copies je->value_len bytes into a_res.str using strncpy without ensuring the destination buffer is large enough. Crafted long string values, including crafted enum definitions stored in user variables, can therefore overflow the heap buffer. The issue affects MariaDB 11.4 before 11.4.10 and 11.8 before 11.8.6; the content also states it is fixed in 12.2.2.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

A logged-in attacker can trigger a server crash with a single SQL query, causing denial of service. The supporting content further states that, under tightly controlled heap-layout conditions, the overflow can partially overwrite adjacent heap metadata, pivot a user-variable value pointer to arbitrary process memory, and enable arbitrary read/write of privileged in-process structures. In principle this can be developed into remote code execution, but the content emphasizes that the required memory-layout control is generally only achievable in a lab environment, making reliable real-world RCE substantially harder than simple crash exploitation.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure by limiting database access to trusted authenticated users only, since exploitation requires a valid login. Restrict the ability of lower-privileged users to submit arbitrary SQL invoking JSON_SCHEMA_VALID() on attacker-controlled inputs, especially crafted JSON schema enum definitions and user-variable-based payloads. Monitor for crashes or suspicious JSON_SCHEMA_VALID-related queries. These are only partial mitigations; the content indicates the definitive fix is upgrading to a patched version.

Remediation

Patch, then assume compromise.

Upgrade MariaDB Server to a fixed release. The provided content states the issue is fixed in MariaDB 11.4.10, 11.8.6, and 12.2.2. Apply the vendor patch/update corresponding to MDEV-38356 / GHSA-4rj5-2227-9wgc and ensure all affected deployments are moved off vulnerable 11.4.x and 11.8.x builds prior to those versions.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
CVE-2026-32710MaturityPoCVerified exploit

This repository is a working exploit lab for CVE-2026-32710 targeting MariaDB 11.4.x, confirmed on 11.4.9. It is not a scanner or detector; it contains a full exploit chain. The main component is exploit.py, a standalone Python exploit that implements a minimal MySQL/MariaDB protocol client over raw TCP sockets and performs a two-stage attack. Stage 1 exploits a heap out-of-bounds write in JSON_SCHEMA_VALID() to corrupt user-variable metadata and achieve a two-hop arbitrary write into Security_context::master_access, turning a SELECT-only account into one with ALL PRIVILEGES WITH GRANT OPTION. It then persists the escalation with GRANT ALL so the privilege change survives the eventual session crash and restart. Stage 2 uses the elevated privileges to load a malicious UDF shared library into the MariaDB plugin directory and invoke sys_exec() to run arbitrary operating system commands as the mysql user. Repository structure is small and purpose-built: exploit.py is the primary exploit; raptor_udf.c is the malicious UDF source implementing sys_exec() via system(); Dockerfile builds a MariaDB 11.4.9 lab image, compiles the UDF, and weakens plugin_dir permissions for convenience; init.sql creates the initial lowpriv account with only SELECT on test.*; setup.sh automates building and launching the vulnerable Docker lab with SYS_PTRACE and port 3306 exposed; README.md documents the vulnerability, exploitation stages, constraints, and usage. The exploit’s main capability is privilege escalation followed by command execution. It targets MariaDB over the network using SQL queries sent to TCP/3306, but it also relies on local/container introspection in the provided lab to read /proc/1/mem and discover heap addresses needed for reliable exploitation. The README explicitly notes that the actual corruption and arbitrary-write chain are pure SQL over TCP, while the memory introspection is a lab-only substitute for a real info leak. Because the payload is functional but environment-specific and not integrated into a broader exploitation framework, the maturity is best classified as OPERATIONAL.

dinosnDisclosed May 6, 2026pythoncnetworkweblocal
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
MariadbMariadbapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity9

Community discussion across Reddit, Mastodon, and other social sources.