⚠️

Disclaimer & Liability

The content provided on this website is for educational, research, and security awareness purposes only. Any unauthorized, illegal, or abusive use of the information, tools, and techniques discussed is solely the responsibility of the user. The author and publisher assume no liability for any damages, injuries, or consequences resulting from the misuse of this content.

MariaDB CVE-2026-86047: Improper Quoting Enables SQL Injection During Export and Restore | Alireza Bolbolabadi - Red Team Security
LOADING

MariaDB CVE-2026-86047: Improper Quoting Enables SQL Injection During Export and Restore

Executive summary

MariaDB CVE-2026-86047 is a SQL injection and privilege-escalation vulnerability caused by incomplete quoting when MariaDB serializes database metadata and logical backups.

The affected functionality includes the SHOW CREATE SERVER and SHOW CREATE USER commands, as well as the mariadb-dump utility. According to the source advisory, a low-privileged authenticated user can create database objects with crafted identifiers or values. Those inputs may then be embedded into generated SQL without proper delimiting. If a privileged administrator or automated restore process executes the resulting output, the injected statements run under that account's privileges.

The vulnerability is not described as an unauthenticated, directly exploitable database flaw. Its practical impact depends on a second stage: an attacker must be able to introduce malicious names or values, and a higher-privileged user or system must consume the affected output. The provided context does not include affected version ranges, fixed versions, a CVSS vector, evidence of active exploitation, or a technical severity score. Those details should be verified through RHSA-2026:104719 and the corresponding upstream MariaDB advisory before deployment decisions are finalized.

How the vulnerability works

The flaw is a quoting and escaping defect in output-generation paths. During normal operation, a database parser treats identifiers and values according to MariaDB's syntax rules. During serialization, however, the affected components do not consistently preserve those boundaries in the SQL text they produce.

That distinction matters because generated SQL is often treated as a trusted administrative artifact. A dump file may be copied to another server, reviewed only superficially, and then applied by a highly privileged account. If attacker-controlled content has not been quoted correctly, the SQL parser can interpret it as additional statements or altered command structure rather than as a literal identifier or value.

Affected commands and tools

The source identifies three affected serialization paths:

  • SHOW CREATE SERVER

  • SHOW CREATE USER

  • mariadb-dump

The precise implementation details and the full set of identifier types that can reach these paths are not specified in the supplied context. It would therefore be inappropriate to assume that only one object type is exploitable or that every deployment is equally exposed.

Attack prerequisites

The source describes the following conditions for exploitation:

  1. The attacker has authenticated access to MariaDB.

  1. The attacker has low-level privileges sufficient to create or influence database objects handled by an affected serialization path.

  1. The attacker supplies a crafted identifier or value.

  1. The affected output is generated and subsequently executed.

The final condition is central to the risk. The attacker does not necessarily need direct access to the privileged account that runs the dump or restore operation. Instead, the attack transfers attacker-controlled SQL through an administrative workflow into a more privileged execution context.

Real-world impact

SQL injection

A successfully crafted object name or value can escape its intended serialized position and introduce additional SQL. The generated statement may then modify data, alter configuration, invoke additional queries, or perform other actions supported by the executing account.

Privilege escalation

The most important consequence is the difference between the attacker's privileges and those of the consumer of the output. If a database administrator applies a contaminated dump, injected statements execute with that administrator's authority. Automated backup, migration, and schema-management systems can provide the same elevated context if their service accounts have broad permissions.

The resulting impact can include unauthorized data access, data manipulation, and administrative changes. More severe outcomes may be possible if the executing identity also has permissions for file operations, extensions, or other powerful MariaDB features, but the provided source does not confirm such outcomes and they should not be treated as established impact.

Integrity of backup and migration workflows

Even when a restore does not produce an immediate administrative takeover, it may produce an altered database state. This matters for organizations that treat successful restore completion as proof that a backup is trustworthy. A dump generated from a server containing maliciously named objects should be considered untrusted until the vulnerability has been addressed or its contents have been independently reviewed.

Exposure and risk assessment

CVE-2026-86047 should not be assessed solely from the severity label attached to the supplied source. A technical score of 0/100 in the context reflects the absence of linked exploit metadata, a CVSS vector, and exploitation intelligence; it is not evidence that the flaw is harmless.

The vulnerability nevertheless has meaningful constraints. Authentication is required, attacker privileges are needed, and exploitation relies on a downstream user or system executing the contaminated SQL. These factors make the issue different from an unauthenticated remote code execution path. At the same time, the privilege transition described in the advisory can materially amplify impact in common administrative workflows.

The supplied context does not state whether exploitation has been observed in the wild. It also omits exact affected and fixed versions. Accordingly, deployment-specific exposure cannot be determined conclusively from this source alone.

Detection and investigation

Because the payload resides in generated SQL rather than in a normal request path, ordinary web application monitoring may not reveal it. Relevant artifacts include:

  • mariadb-dump files

  • Output captured from SHOW CREATE SERVER

  • Output captured from SHOW CREATE USER

  • Automated restore logs

  • Schema migration artifacts

A useful investigation is to compare database object names and values against expected naming policies. Review generated SQL for statement delimiters or comment sequences appearing where only a quoted identifier or escaped value should occur. The exact character set of valid identifiers must be established for the deployment, since a broad block on punctuation could conceal legitimate objects without proving exploitation.

Organizations should also review whether dump and restore jobs run under dedicated identities rather than interactive DBA accounts. Service-account isolation can reduce the blast radius even before all affected systems are upgraded.

Mitigation guidance

The primary mitigation is to apply the vendor-provided correction for CVE-2026-86047. For Red Hat-packaged MariaDB, RHSA-2026:104719 is the relevant advisory identifier. Equivalent distribution and upstream advisories should be checked for other platforms.

Until a fixed release can be applied, organizations can reduce exposure by:

  • Restricting who can create objects that will be serialized through the affected paths.

  • Restricting access to SHOW CREATE SERVER, SHOW CREATE USER, and mariadb-dump where operational requirements allow.

  • Running restores with a dedicated least-privilege identity.

  • Reviewing generated dumps and SHOW CREATE output before execution.

  • Monitoring for object identifiers that violate established naming conventions.

  • Avoiding automatic execution of newly generated dumps without validation.

These controls are compensating measures, not substitutes for patching. Naming policies also cannot cover every identifier accepted by MariaDB or every value-bearing field exposed by the affected commands.

Conclusion

CVE-2026-86047 introduces a two-stage privilege-boundary failure: a low-privileged authenticated user can place crafted content into generated SQL, and a privileged workflow may later execute it. Its severity is therefore closely tied to environment configuration, especially the permissions assigned to dump, migration, and restore accounts. The strongest immediate concern is not direct database compromise from the internet, but contamination of trusted administrative artifacts. Patch guidance, version scope, and any exploitation intelligence remain unverified in the supplied context and should be confirmed through the authoritative vendor records.

·
← News