WordPress SEO Plugin - Rank Math < 1.0.41 - Privilege Escalation via Unprotected REST API Endpoint



Description
This plugin registered a REST-API endpoint, rankmath/v1/updateMeta, which failed to include a permission_callback used for capability checking. The endpoint called a function, update_metadata which could be used to update the slug on existing posts, or could be used to delete or update metadata for posts, comments, and terms. This endpoint also allowed for updating metadata for users. WordPress user permissions are stored in the usermeta table, which meant that an unauthenticated attacker could grant or revoke administrative privileges for any registered user.
Proof of Concept
curl -X POST --data "objectID=<user ID to edit>&objectType=user&meta[wp_user_level]=10&meta[wp_capabilities][administrator]=1" http://example.site/wp-json/rankmath/v1/updateMeta

Affects Plugin

fixed in version 1.0.41

References

CVE 2020-11514
URL https://www.wordfence.com/blog/2020/03/critical-vulnerabilities-affecting-over-200000-sites-patched-in-rank-math-seo-plugin/

Classification

Type PRIVESC
OWASP Top 10 A2: Broken Authentication and Session Management
CWE CWE-269

Miscellaneous

Original Researcher Ramuel Gall (Wordfence)
Submitter Ramuel Gall
Views 2237
Verified No
WPVDB ID 10157

Timeline

Publicly Published 2020-03-31 (about 2 months ago)
Added 2020-03-31 (about 2 months ago)
Last Updated 2020-04-09 (about 2 months ago)

Our Other Services

Online WordPress Vulnerability Scanner WPScan WordPress Security Plugin