Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
mysql-jdv-definer-sqli — MySQL Community Server 26.7.0 - High - JSON Duality DEFINER SQLi - NO_BACKSLASH_ESCAPES | Kitploit
Tools/GitHubGitHub/abraxas/mysql-jdv-definer-sqli
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingDatabase SecurityLabs & Practice
GitHubabraxas/mysql-jdv-definer-sqli

mysql-jdv-definer-sqli

MySQL Community Server 26.7.0 - High - JSON Duality DEFINER SQLi - NO_BACKSLASH_ESCAPES

View Repository
1312 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Abraxas Labs - mysql-jdv-definer-sqli

abraxaslabs.tech  ·  github.com/abraxas  ·  @abraxas_null  ·  [email protected]  ·  mysql-jdv-definer-sqli

mysql-jdv-definer-sqli

Class: SQLi Reach: Remote

MySQL Community Server mysqld 26.7.0 (06a5c1c) - Oracle

JSON Duality DML concatenates JSON string values with escape_string_for_mysql (backslash only), then parse_sql under the invoker sql_mode after swapping to the view DEFINER sctx. SET SESSION sql_mode='NO_BACKSLASH_ESCAPES' makes \' end the SQL literal. A JSON string containing ' injects a subquery / SET-list as DEFINER. Lab: invoker with only DML on the view reads secret.s into the projected name column.

Default CREATE VIEW is DEFINER. X Plugin already branches on that mode. JDV does not. Feature-gated: needs a JSON Duality View.

IDno CVE yet
ClassSQLi (DEFINER; not RCE)
ReachRemote (authenticated SQL; needs DML on a JSON Duality View)
CWECWE-89
CVSSHigh: 8.1 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
ProductMySQL Community Server mysqld
Affected26.7.0 (06a5c1c99c377fc41b2eba1ea244e8b220bdc3c8)
Authauthenticated; INSERT or UPDATE on a JSON Duality View
LicenseGNU Affero GPL v3.0
Lab127.0.0.1 only. Witness in projected $.name.

What an attacker can do

Hold DML on a SQL SECURITY DEFINER JSON Duality View. SET SESSION sql_mode='NO_BACKSLASH_ESCAPES'. UPDATE (etag from SELECT) a string field whose JSON value contains '. The generated _utf8mb4 '...' literal ends. The rest of the statement runs as DEFINER. Lab selects secret.s.note into the projected name column. Direct SELECT on secret.s is 1142.

Without that sql_mode the same JSON stores as a literal name. The quote stays data.

How I found it

Same 26.7.0 hunt. Default daemon unpublished Crit/High was empty. JSON Duality DML still concatenates values.

sbuf.append("_utf8mb4 '");
escape_string_for_mysql(&my_charset_utf8mb4_bin, ...);
sbuf.append(1, '\'');

create_sctx_guard installs view_sctx before run_substmt. Invoker sql_mode is what parse_sql sees.

Wrong turns: SQL SECURITY DEFINER between the view name and AS is 1064 (default is already DEFINER). Same name as the current row is skipped (is_equal); inject against a different value. Etag is required.

Lab

cd lab
./run.sh

Image mysql:26.7.0. Published 127.0.0.1:18640. View app.dv DEFINER root@% over app.t. Secret in secret.s. Victim has SELECT/INSERT/UPDATE on the view only.

SUCCESS mysql-jdv-definer-sqli victim-secret=denied nbe-inject=yes view-has-witness=yes default-mode-inject=no dump=26.7.0 image=mysql:26.7.0 MYSQL-JDV-DEFINER-SQLI-WITNESS

The fix

Escape JDV DML strings with the same NO_BACKSLASH_ESCAPES branch X Plugin already has (escape_sql_quote vs escape_string_for_mysql). Parameterize the generated INSERT/UPDATE. Do not parse_sql concatenated values under a DEFINER sctx.

References

  • github.com/mysql/mysql-server tag mysql-26.7.0 (06a5c1c99c377fc41b2eba1ea244e8b220bdc3c8)
  • sql/json_duality_view/dml.cc append_json_dom / create_sctx_guard
  • Sibling packs: abraxas/mysql-mysqldump-show-tables-overflow · abraxas/mysql-mysqldump-tab-path · abraxas/mysql-mysqlbinlog-raw-path · abraxas/mysql-set-role-leftover
Download Tool