MariaDB server_audit Plugin Logging Bypass via Inline Comments (CVE-2026-3494)
by KKongTen · 2026-07-05
- Severity
- Medium
- CVE
- CVE-2026-3494
- Category
- network
- Affected product
- MariaDB Server server_audit audit-logging plugin
- Affected versions
- MariaDB 11.8.6 (regression versus 11.8.5 and below, including 10.x branches)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-05 |
| Author / Researcher | KKongTen |
| CVE / Advisory | CVE-2026-3494 |
| Category | network |
| Severity | Medium |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | mariadb, audit-log-bypass, server_audit, logging-evasion, database, regression, sql |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | MariaDB Server server_audit audit-logging plugin |
| Versions Affected | MariaDB 11.8.6 (regression versus 11.8.5 and below, including 10.x branches) |
| Language / Platform | Python 3 (PoC), Docker Compose lab, target is MariaDB server |
| Authentication Required | Yes (a database user account) |
| Network Access Required | Yes |
Summary
CVE-2026-3494 is a logging-omission regression in MariaDB’s server_audit plugin. When server_audit is configured with filters such as QUERY_DCL, QUERY_DDL, and QUERY_DML, certain queries containing inline # or -- comments — including queries that trigger error 1046 (“No database selected”) and SET PASSWORD statements with a trailing comment — are silently omitted from the audit log on MariaDB 11.8.6, even though the same queries were correctly logged on 11.8.5 and earlier. The included PoC spins up three MariaDB versions in Docker (10.3.39, 11.8.5, 11.8.6) and runs a matrix of identical test queries against each, comparing the resulting server_audit.log contents to demonstrate the logging gap on 11.8.6.
Vulnerability Details
Root Cause
A parser behavior change in the server_audit plugin’s query-classification logic on MariaDB 11.8.6 appears to mishandle statements containing inline #/-- comments in certain error and DCL-statement scenarios, causing those queries to be dropped from the audit trail instead of logged.
Attack Vector
- Obtain a database account with access to a MariaDB 11.8.6 instance running
server_auditwith DCL/DDL/DML filters enabled. - Issue a sensitive query (e.g.
SET PASSWORD ... # comment) or a query that triggers error 1046, with a trailing inline comment. - The audit plugin fails to record the statement in
server_audit.log, while equivalent uncommented queries or the same queries on 11.8.5 are logged normally. - Sensitive actions (e.g. password changes) can be performed while evading the audit trail, hindering detection and forensic reconstruction.
Impact
Attackers or malicious insiders with database access can perform sensitive operations, such as password changes, without leaving an audit trail, undermining compliance and incident-response capabilities.
Environment / Lab Setup
Target: MariaDB 10.3.39 / 11.8.5 / 11.8.6 (Docker Compose, three parallel instances)
Attacker: Docker, Docker Compose, Python 3, pymysql
Proof of Concept
PoC Script
See
poc/poc.py,docker-compose.yml,Dockerfile,config/, andinit/in this folder.
| |
The script connects to all three MariaDB instances (ports 3306/3307/3308), runs five test-case queries (normal query, two error-triggering queries, a commented SET PASSWORD, and a commented SELECT) against each, then reads and compares each instance’s server_audit.log to show which queries were logged versus silently omitted on 11.8.6.
Detection & Indicators of Compromise
Signs of compromise:
- Password or privilege changes observed via other means (e.g. application logs) with no corresponding
server_audit.logentry - Queries containing inline comments immediately preceding sensitive operations
- Discrepancies when comparing audit coverage across MariaDB versions during upgrades
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor MariaDB advisories for a server_audit parser fix |
| Interim mitigation | Avoid relying solely on server_audit for compliance-critical logging until fixed; supplement with general query logging or proxy-level auditing that is independent of comment parsing |
References
Notes
Mirrored from https://github.com/KKongTen/CVE-2026-3494 on 2026-07-05.
| |