Description
The register_routes function in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php in the REST API in WordPress 4.7.x before 4.7.2 does not require an integer identifier, which allows remote attackers to modify arbitrary pages via a request for wp-json/wp/v2/posts followed by a numeric value and a non-numeric value, as demonstrated by the wp-json/wp/v2/posts/123?id=123helloworld URI.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | wordpress | 4.7.2+dfsg-1 | — |
| Debian 13 | wordpress | 4.7.2+dfsg-1 | — |
| Debian 12 | wordpress | 4.7.2+dfsg-1 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
WordPress REST API Content Injection
auxiliary/scanner/http/wordpress_content_injection
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
References
- https://codex.wordpress.org/Version_4.7.2
- https://make.wordpress.org/core/2017/02/01/disclosure-of-additional-security-fix-in-wordpress-4-7-2/
- https://blogs.akamai.com/2017/02/wordpress-web-api-vulnerability.html
- https://gist.github.com/leonjza/2244eb15510a0687ed93160c623762ab
- https://blog.sucuri.net/2017/02/content-injection-vulnerability-wordpress-rest-api.html
- https://github.com/WordPress/WordPress/commit/e357195ce303017d517aff944644a7a1232926f7
- https://wordpress.org/news/2017/01/wordpress-4-7-2-security-release/
- [oss-security] 20170210 Re: Asking for a CVE id for the WordPress Privilege Escalation vulnerability (4.7/4.7.1) mailing-list
- 1037731 vdb-entry