Aerosol Posted March 13, 2015 Report Posted March 13, 2015 OVERVIEW==========WPML is the industry standard for creating multi-lingual WordPresssites. Three vulnerabilities were found in the plug-in. The mostserious of them, an SQL injection problem, allows anyone to read thecontents of the WordPress database, including user details andpassword hashes, without authentication.System administrators should update to version 3.1.9.1 releasedearlier this week to resolve the issues.DETAILS========1. SQL injectionWhen WPML processed a HTTP POST request containing the parameter”action=wp-link-ajax”, the current language is determined by parsingthe HTTP referer. The parsed language code is not checked forvalidity, nor SQL-escaped. The user doesn’t need to be logged in.By sending a carefully crafted referer value with the mentioned POSTrequest parameter, an attacker can perform SQL queries on arbitrarytables and retrieve their results. In addition to the standardWordPress database and tables, the attacker may query all otherdatabases and tables accessible to the web backend.The following HTML snippet demonstrates the vulnerability:<script>var union="selectuser_login,1,user_email,2,3,4,5,6,user_pass,7,8,9,10,11,12 fromwp_users";if (document.location.search.length < 2) document.location.search="lang=xx' UNION "+union+" -- -- ";</script><form method=POST action="https://YOUR.WORDPRESS.BLOG/comments/feed"><input type=hidden name=action value="wp-link-ajax"><input type=submit></form>The results of the SQL query will be shown in the comments feed XML-formatted.2. Page/post/menu deletionWPML contains a ”menu sync” function which helps site administratorsto keep WordPress menus consistent across different languages. Thisfunctionality lacked any access control, allowing anyone to deletepractically all content of the website - posts, pages, and menus.Example:<form method=POSTaction="https://YOUR.WORDPRESS.BLOG/?page=sitepress-multilingual-cms/menu/menus-sync.php"><input type=hidden name="action" value="icl_msync_confirm"><input type=text name="sync" size=50 value="del[x][y][12345]=z"><input type=submit></form>Submitting the above form would delete the row with the ID 12345 inthe wp_posts database. Several items be deleted with the same request.3. Reflected XSSThe ”reminder popup” code intended for administrators in WPML didn’tcheck for login status or nonce. An attacker can direct target usersto an URL like:https://YOUR.WORDPRESS.BLOG/?icl_action=reminder_popup&target=javascript%3Aalert%28%2Fhello+world%2f%29%3b%2f%2fto execute JavaScript in their browser. This example bypasses theChrome XSS Auditor.In the case of WordPress, XSS triggered by an administrator can leadto server-side compromise via the plugin and theme editors.CREDITS========The vulnerabilities were found by Jouko Pynnonen of Klikki Oy whileresearching WordPress plugins falling in the scope of the Facebook bugbounty program.The vendor was notified on March 02, 2015 and the patch was releasedon March 10.Vendor advisory: http://wpml.org/2015/03/wpml-security-update-bug-and-fix/An up-to-date version of this document can be found on our websitehttp://klikki.fi .-- Jouko Pynnönen <jouko@iki.fi>Klikki Oy - http://klikki.fiSource Quote