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
phpmyadmin-importldi — phpMyAdmin 5.2.3 - High - Remote - SQLi - ImportLdi TERMINATED BY leftover | Kitploit
Tools/GitHubGitHub/abraxas/phpmyadmin-importldi
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingLabs & Practice
GitHubabraxas/phpmyadmin-importldi

phpmyadmin-importldi

phpMyAdmin 5.2.3 - High - Remote - SQLi - ImportLdi TERMINATED BY leftover

View Repository
3 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 - phpmyadmin-importldi

abraxaslabs.tech  ·  github.com/abraxas  ·  @abraxas_null  ·  [email protected]  ·  phpmyadmin-importldi

phpmyadmin-importldi

Class: SQLi Reach: Remote

phpMyAdmin 5.2.3 (RELEASE_5_2_3 / 962857e) - phpMyAdmin

ImportLdi.php builds LOAD DATA with FIELDS/LINES TERMINATED BY from POST ldi_terminated and ldi_new_line. Those two strings are concatenated into single-quoted SQL. ldi_enclosed and ldi_escaped go through escapeString. phpMyAdmin sets PMA_ENABLE_LDI on /import so MYSQLI_OPT_LOCAL_INFILE is on.

A signed-in user POSTs format=ldi with a quote in ldi_terminated. The issued LOAD DATA contains the raw POST inside TERMINATED BY. SQL injection into the user connection, not the control user.

IDno CVE yet
ClassSQLi
ReachRemote (authenticated cookie login; table import, format ldi)
CWECWE-89
CVSSMedium: 6.5 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
ProductphpMyAdmin
Affected5.2.3 tag RELEASE_5_2_3 (962857e4f63d42e38f11ff4d63f5e722018add76)
Authauthenticated cookie login. Table import, format ldi
LicenseGNU Affero GPL v3.0
Lab127.0.0.1 only

What an attacker can do

A signed-in phpMyAdmin user who can open Table import can inject SQL into LOAD DATA ... TERMINATED BY on their MySQL connection.

PrivilegeMethod / sinkRecon / integrity / availabilityLab-proven or inferred
Break the FIELDS TERMINATED BY literalPOST index.php?route=/import format=ldi ldi_terminated with a quoteIntegrity of the statement PMA buildsLab-proven. HTML SQL box: TERMINATED BY '',PMA-IMPORTLDI-WITNESS'
Keep ENCLOSED BY in-bandSame POST, quote in ldi_enclosedNegative controlLab-proven. ENCLOSED BY is escaped
Extra SQL on the user connection (INTO OUTFILE / stacked if allowed)Same sink once the string is closedIntegrity of the user connectionInferred. Lab stops at the broken delimiter. Default mysqli::query is single-statement
MySQL-side file read/writeSame LOAD DATA if the account has FILE or LOCAL INFILE to the web serverIntegrity of files mysqld can touchInferred. Not granted here. Not claimed

Closed on this lab: unauthenticated access, control-user / pmadb, OS include LFI, and FILE-gated read/write. The signed-in user already has a SQL box; this leftover is the unescaped delimiter inside a statement PMA builds for them.

Same pin: WebAuthn CustomServer leftover.

How I found it

I pinned phpMyAdmin RELEASE_5_2_3. Import plugins that build LOAD DATA by hand are a quoting audit. Two of four delimiter fields were escaped. Two were not:

$sql .= ' FIELDS TERMINATED BY \'' . $ldi_terminated . '\'';
...
$sql .= ' LINES TERMINATED BY \'' . $ldi_new_line . '\'';

ldi_enclosed / ldi_escaped call $dbi->escapeString. Common.php sets PMA_ENABLE_LDI on /import + format=ldi. Routes GET|POST /import and GET|POST /table/import.

Wrong turns already recorded: claiming LFI without a FILE grant; treating the SQL box as the finding (the leftover is the unescaped delimiter PMA concatenates); claiming control-user / pmadb; a reverse shell. Theatre.

Lab

python3 phpmyadmin-importldi-Abraxas-Labs.py
# or: cd lab && ./run.sh

Target only http://127.0.0.1:19290. Images phpmyadmin:5.2.3 and mysql:8.0. Compose project phpmyadmin-importldi. Stack tears down after the run.

Cookie login. POST /import with format=ldi and a quote in ldi_terminated. Issued LOAD DATA LOCAL INFILE ... INTO TABLE \ldi_target` FIELDS TERMINATED BY '',PMA-IMPORTLDI-WITNESS'. The same quote in ldi_enclosedstored as an escapedENCLOSED BY. Pin source on the 5.2.3 image still has '.$ldi_terminated.'and$dbi->escapeString($ldi_enclosed)`.

SUCCESS phpmyadmin-importldi pin=RELEASE_5_2_3 how=live TERMINATED-BY-raw ENCLOSED-escaped PMA-IMPORTLDI-WITNESS

The fix

escapeString on ldi_terminated and ldi_new_line, the same as enclosed and escaped. Int-cast skip_queries.

References

  • github.com/phpmyadmin/phpmyadmin tag RELEASE_5_2_3 (962857e4f63d42e38f11ff4d63f5e722018add76)
  • libraries/classes/Plugins/Import/ImportLdi.php
  • Same pin: PMA-5.2.3-WebAuthn-2FA
  • CWE-89

License

GNU Affero GPL v3.0. See LICENSE. Loopback lab only. No warranty.

Download Tool