If triggered by a logged-in administrator, under default settings the attacker can leverage the vulnerability to execute arbitrary code on the server via the plugin and theme editors.
Alternatively the attacker could change the administrator’s password, create new administrator accounts, or do whatever else the currently logged-in administrator can do on the target system.
If the comment text is long enough, it will be truncated when inserted in the database. The MySQL TEXT type size limit is 64 kilobytes, so the comment has to be quite long.
The truncation results in malformed HTML generated on the page. The attacker can supply any attributes in the allowed HTML tags, in the same way as with the two recently published stored XSS vulnerabilities affecting the WordPress core.
The vulnerability bears a similarity to the one reported by Cedric Van Bock haven in 2014 (patched this week, after 14 months). Instead of using an invalid character to truncate the comment, this time an excessively long comment is used for the same effect.
The similar vulnerability released in November 2014 could be exploited in the administrative Dashboard while the comment is still in the moderation queue. Some exploit attempts of this have been recently reported in the wild.
WordPress has refused all communication attempts about our ongoing security vulnerability cases since November 2014. We have tried to reach them by email, via the national authority (CERT-FI), and via Hacker One. No answer of any kind has been received since November 20, 2014. According to our knowledge, their security response team have also refused to respond to the Finnish communications regulatory authority who has tried to coordinate resolving the issues we have reported, and to staff of Hacker-one, which has tried to clarify the status our open bug tickets.
To prevent exploitation, administrators should disable comments (Dashboard, Settings/Discussion, select as restrictive options as possible). Do not approve any comments.
Patch available: WordPress 4.2.1.