|
|
| Details : SecurityAlert |
|
|
Topic : | WordPress XSS vulnerability in RSS Feed Generator
|
SecurityAlert : 4662
CVE : CVE-2008-5278
CWE : CWE-79
SecurityRisk : Low (About)
Remote Exploit : Yes
Local Exploit : No
Victim interaction required : Yes
Exploit Given : Yes
Credit : Jeremias Reith
Published : 02.12.2008
Affected Software : | wordpress:wordpress:2.6.1
wordpress:wordpress:2.6
wordpress:wordpress:2.5
wordpress:wordpress:2.5.1
wordpress:wordpress:2.3
wordpress:wordpress:2.2_revision5003
wordpress:wordpress:2.3.2
wordpress:wordpress:2.3.3
wordpress:wordpress:2.3:beta3
wordpress:wordpress:2.3.1
wordpress:wordpress:2.3:rc1
wordpress:wordpress:2.3.1:rc1
wordpress:wordpress:2.1.3_rc1
wordpress:wordpress:2.1.3
wordpress:wordpress:2.1.3_rc2
wordpress:wordpress:2.2.3
wordpress:wordpress:2.2_revision5002
wordpress:wordpress:2.2
wordpress:wordpress:2.2.2
wordpress:wordpress:2.2.1
wordpress:wordpress:2.2.0
wordpress:wordpress:2.1:alpha_3
wordpress:wordpress:2.0.8
wordpress:wordpress:2.0.9
wordpress:wordpress:2.0.3
wordpress:wordpress:2.0.4
wordpress:wordpress:2.0.5
wordpress:wordpress:2.0.6
wordpress:wordpress:2.0.7
wordpress:wordpress:2.1
wordpress:wordpress:2.1.1
wordpress:wordpress:2.1.2
wordpress:wordpress:2.0.10_rc2
wordpress:wordpress:2.0.11
wordpress:wordpress:1.5.1.3
wordpress:wordpress:1.5.2
wordpress:wordpress:2.0
wordpress:wordpress:2.0.1
wordpress:wordpress:2.0.10
wordpress:wordpress:2.0.10_rc1
wordpress:wordpress:1.6
wordpress:wordpress:2.0.2
wordpress:wordpress:1.3.1
wordpress:wordpress:1.5
wordpress:wordpress:1.5.1.2
wordpress:wordpress:1.5.1
wordpress:wordpress:1.2.1
wordpress:wordpress:1.2.2
wordpress:wordpress:1.5-strayhorn
wordpress:wordpress:1.5.1.1
wordpress:wordpress:1.4
wordpress:wordpress:1.2:beta
wordpress:wordpress:1.2-mingus
wordpress:wordpress:1.2-delta
wordpress:wordpress:1.0-platinum
wordpress:wordpress:1.0.2-blakey
wordpress:wordpress:1.0.1-miles
wordpress:wordpress:1.0.2
wordpress:wordpress:1.2
wordpress:wordpress:1.0
wordpress:wordpress:1.0.1
wordpress:wordpress:0.72:rc1
wordpress:wordpress:0.6.2.1:beta_2
wordpress:wordpress:0.6.2:beta_2
wordpress:wordpress:0.71-gold
wordpress:wordpress:0.711
wordpress:wordpress:0.72:beta1
wordpress:wordpress:0.72:beta2
wordpress:wordpress:0.7
wordpress:wordpress:0.71
wordpress:wordpress:0.6.2.1
wordpress:wordpress:0.72
wordpress:wordpress:0.6.2
wordpress:wordpress:2.6.3 and previous versions |
 Advisory Text : ===== noXSS.org Security Advisory ======
Advisory: WordPress XSS vulnerability in RSS Feed Generator
Author: Jeremias Reith <jr (at) noxss (dot) org [email concealed]>
Published: 2008/11/25
Affected: WordPress < 2.6.5
Summary
=======
WordPress prior to v2.6.3 fails to sanitize the Host header variable
correctly when generating RSS feeds and is therefore prune to XSS
attacks.
Web Sites running in a name based virtual hosting setup are not
affected as long as they are not the default virtual host.
Moreover we only found installations running on the Apache web server
to be affected.
Vulnerability Details
=====================
The function self_link() in wp-includes/feed.php is used to generate
absolute URLs for the <atom:link> tag in ATOM and RSS 2.0 feeds:
function self_link() {
echo 'http'
. ( $_SERVER['https'] == 'on' ? 's' : '' ) . '://'
. $_SERVER['HTTP_HOST']
. wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1);
}
The function does not sanitize the HTTP_HOST variable in any way but
WordPress replaces all $_SERVER variables with escaped ones in
wp-settings.php:
$_SERVER = add_magic_quotes($_SERVER);
In almost all setups add_magic_quotes() runs
mysql_real_escape_string() over the elements and returns the modified
array. Unfortunately this escaping method is not safe in markup
context.
PoC
====
The Apache web server only disallows '/', '\' and '..' within the host
header. The header can therefore contain markup making the following
PoC possible:
curl -H "Host: \"><body onload=alert(String.fromCharCode(88,83,83))>"
http://www.example.org/blog/feed
The given example request will return (without additional newlines):
-- snip --
...
<atom:link href="http://\">
<body onload=alert(String.fromCharCode(88,83,83))>
/blog/feed" rel="self" type="application/rss+xml" />
...
-- snip --
The embedded JavaScript will be executed in Firefox 3.0.4 due to the
triggered switch to Quirks mode.
Exploit
=======
The following exploit is a semi-stored XSS attack and has been tested
with the following setup:
- Apache 2.x with IP based virtual hosting
- Wordpress 2.6.3 installed in /blog/
- WP Super Cache 0.84
- Firefox 3.0.4
WP Super Cache is a popular WordPress plugin that adds static file
caching to WordPress. It greatly increases performance and is
often used. It saves generated pages in the wp-content/cache directory
and adds mod_rewrite rules to serve cached pages statically.
Issuing a malicious request to a vulnerable WordPress installation
will lead to a file containing the XSS to be generated and placed
within the document root.
Request:
curl -H "Host: \"><body onload=alert(String.fromCharCode(88,83,83))>"
http://www.example.org/blog/feed
Generated file:
http://example.org/blog/wp-content/cache/wp-cache-#md5sum#.html
Firefox will execute the embedded JavaScript even tough the feed is
XML because the file is served as text/html.
The only missing the step is the calculation cached file's MD5 sum.
The following code generates the MD5 checksum:
php -r 'echo md5("\"><body
onload=alert(String.fromCharCode(88,83,83))>".
"/blog/feed"), "\n";'
In the default setup the MD5 sum can be generated by concatenating the
contents of HTTP_HOST and REQUEST_URI resulting in
0d2ca4617758433a7864d57493be2c5b for the given example.
This file can be accessed until the cache expiration mechanism removes
it. The default expire time is 3600 seconds.
Vendor Response
===============
2008-11-17 Reported to vendor
2008-11-17 Initial response from vendor
2008-11-25 Release of version 2.6.5
0? *?H?÷
?0?10 +0? *?H?÷
?!0?Ú0?C Cçy³±è¾;Ü??0|ó?0
*?H?÷
0b10 UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing
CA0
080129113510Z
090128113510Z0B10UThawte Freemail Member10 *?H?÷
jr (at) terragate (dot) net0 [email concealed]?"0
*?H?÷
?0?
?³Æ+Z?Ö¹dàyy
Õ?!£VaEÑ?? +ë?øìÈ?�
¾|äb㡺1Á©òbc[|UÖhÀ?úxy`=ư@R
91;ç¥Å/?o8Ýc¬z«ª??4?ûÙ
24;{æÞ?~k¾ivÀ]
dwu]SÝ³¡kÄP?2~ê¥?^?Èá??ۍ
5;&úhWo<?îM^Kÿúp#eô?|^kQQ²:´¶æ'©+?Ç
OÏç¿w;??zC?ÿU?O�YO)ÑVW?ÑxqI¯÷
ÎýËêÇ?>?ö¾ÿb=P-KÃZÜâ"ÑïëßÝIî??9¦
àÝUÐ
££-0+0U0jr (at) terragate (dot) net0 [email
concealed]Uÿ00
*?H?÷
½µ?êá\ä¹.ñ?eÞò&
#183;D?mÌë
«w?UÞå1@?BÛÔs:í-¢ÇªÏÑHx³G];
Õ¡?ù?ÇKSØ·?æÖ?^E?jW6T
LZ?Z(`ÈgI?Éç~wØ?ÛE?þf_XDQ*?ê?^ô!?×?¦ñ
;LÞ�Ññ?ª0??0?¨
0
*?H?÷
0Ñ10 UZA10UWestern Cape10U Cape
Town10U
Thawte Consulting1(0&UCertification Services
Division1$0"UThawte Personal Freemail CA1+0) *?H?÷
personal-freemail (at) thawte (dot) com0 [email concealed]
030717000000Z
130716235959Z0b10 UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing
CA0?0
*?H?÷
0?Ä¦<UsUûN¹Ê?Zh
92;upßéÿ£ì½Íõ[òv½�:a
42;¿QÎÔåP
0×cZ,?p?ÝÉð+?Zª?qV˯<çñ?6$*Ï+Õó?w=
0;+þ»>¿@?d×§¦»?eÑÅ*T?H�§
2;Ñ<
a@dr`·û£?0?0Uÿ0ÿ0
CU<0:08 6 4?2http://crl.tha
wte.com/ThawtePersonalFreemailCA.crl0U0)U"0
¤010UPrivateLabel2-1380
*?H?÷
H?ÑP?ê.Ì
£f¬g�¯¬¾Â¡C??�L!¸ø
6ª-?6/ÀôP
?p<ýáabÃÙ:~?±?Å?t?%P?bÇÛ'qW%Ý©?9??
Oe_?Ú÷÷?ÖÆN®öê4å[5MwãV!x?Ü!5Þ$±ÓF&#
255;]_eO1?0?0v0b10 UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing
CACçy³±è¾;Ü??0|ó?0 + ?o0 *?H?÷
1 *?H?÷
0 *?H?÷
1
081125222111Z0# *?H?÷
1-?ÙhÍ?H½íT??blÎ;Píõ0? +?71x0v0b10 U
ZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing
CACçy³±è¾;Ü??0|ó?0?*?H?÷
1x v0b10 UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing
CACçy³±è¾;Ü??0|ó?0
*?H?÷
?ĵUb$!ö??Í?âªcKâooG?¡uüðÔë×À×9???´k?&
#177;W s®2?k¸ô
Æxõ?Çéò6É?èð¡Á"j5à]{<Q[½
92;7Ú?\G:L?v??®qªÜÑÁ¾?G³_¹SF¨~1~?
2;ÁJ`Ò?ç°0
h?g??T¯å?Ö6úàj8]?ãæäìDÙèΦ
þOr|l?MâK2=ÖÿÙ¤³Å?Iá/l°?XR?p?
e3Ñé?~¤ö×LÓ
?@¢:hÂXú³&%ÊÌ`Ä>».QÄÃT
½9¡r,þ+9"J}
²??UÎ;
References :
http://www.securityfocus.com/archive/1/498652
http://wordpress.org/development/2008/11/wordpress-265/
Feedback :
If you have additional information or notice any errors regarding this security advisory, please use contact form or email us at info()securityreason()com.
|
|
|
|