SecurityReason.com - Our Reason is

Security

Register | Forget Password | Login
SecurityReason
WLB
Services
RSS
Corporate
Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Home arrow SecurityAlert Database

Arrow  Topic :

WordPress XSS vulnerability in RSS Feed Generator


Arrow  SecurityAlert : 4662
Arrow  CVE : CVE-2008-5278
Arrow  CWE : CWE-79
Arrow  SecurityRisk : Low  Security Risk Low  (About)
Arrow  Remote Exploit : Yes
Arrow  Local Exploit : No
Arrow  Victim interaction required : Yes
Arrow  Exploit Available : Yes
Arrow  Credit : Jeremias Reith
Arrow  Published : 02.12.2008

Arrow  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



Arrow  Advisory Content :  

===== 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?1 0 +0? *?H?÷
 ?!0?Ú0?C Cçy³±è¾;Ü??0|ó?0
 *?H?÷
0b1 0 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Ñ1 0 UZA10U Western Cape10U Cape
Town10U
Thawte Consulting1(0&U Certification Services
Division1$0"UThawte Personal Freemail CA1+0) *?H?÷
 personal-freemail (at) thawte (dot) com0 [email concealed]
030717000000Z
130716235959Z0b1 0 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.crl0 U0)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? 0v0b1 0 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? +?71x0v0b1 0 U
ZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing
CACçy³±è¾;Ü??0|ó?0? *?H?÷
  1x v0b1 0 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Î;



Arrow  References :

http://www.securityfocus.com/archive/1/498652
http://wordpress.org/development/2008/11/wordpress-265/




Arrow  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.
Alert

libc:fts_*() Multiple Denial of Service

Security Risk Medium- 2009-10-02

The fts functions are provided for traversing UNIX file hierarchies...

Apache RSS Apache Alert

» Apache 1.3.41 mod_proxy
   Integer overflow (code
   execution)

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion in work
   directory

» Apache Tomcat 6.0.20 and
   5.5.28 insecure partial
   deploy after failed
   undeploy

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion and/or
   alteration

PHP RSS PHP Alert

» PHP 5.2.12/5.3.1
   session.save_path
   safe_mode and
   open_basedir bypass

» PHP 5.2.12/5.3.1 Multiple
   Vulnerabilities

» PHP 5.2.11 libgd multiple
   vulnerabilities

» PHP 5.2.11 tempnam()
   safe_mode bypass

Copyright © SecurityReason.com. All Rights Reserved.