Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Web :: Apps :: bt1239.txt

ECHU.ORG Alert #4: GuppY makes XSS attacks easy

| GuppY makes XSS attacks easy |

VULNERABLE VERSIONS: All versions under 2.4p1

Tested version
GuppY 2.4 on the official GuppY website.

"GuppY is a small web portal, meant to be easy to use for the end user that you are, and which does not require a database to run.This architecture allows then to install it on almost all Internet web sites hosters (or almost all of them), the only preriquisite being that your hoster has to provide the PHP scripting language facility." - GuppY website

GuppY use the postguest.php file for its forum and guestbook modules. This file contain XSS holes, an attacker can execute code since [c=codecolor]text[/c] has no filter.

Problems come from this part:

Line 196: $ptxt = preg_replace("/(\[c=(.*?)\])(.*?)(\[\/c\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);
Line 197: $ptxt = preg_replace("/(\[c=(.*?)\])(.*?)(\[\/C\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);
Line 198: $ptxt = preg_replace("/(\[C=(.*?)\])(.*?)(\[\/c\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);
Line 199: $ptxt = preg_replace("/(\[C=(.*?)\])(.*?)(\[\/C\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);

A badly disposed member can post a message containing code really easily in forum and guestbook modules. Example:
(This proof-of-concept will show a window that can freeze your computer if using Internet Explorer so take care)


In order to avoid the vulnerability, add a filter that will block ;<>*()"'] caracters to lines 196 to 199:

Line 196: $ptxt = preg_replace("/(\[c=([#a-zA-Z0-9]*)\])(.*?)(\[\/c\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);
Line 197: $ptxt = preg_replace("/(\[c=([#a-zA-Z0-9]*)\])(.*?)(\[\/C\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);
Line 198: $ptxt = preg_replace("/(\[C=([#a-zA-Z0-9]*)\])(.*?)(\[\/c\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);
Line 199: $ptxt = preg_replace("/(\[C=([#a-zA-Z0-9]*)\])(.*?)(\[\/C\])/i", "<font style=\"color:\\2\">\\3</font>",$ptxt);

Vendor status
GuppY developper's team has been contacted, a patch has been released tonight that fix the problem. Thanks to aldweb ( webmaster) for his quick answer.

Version 2.4p1:

This vulnerability's orginal paper can be found here:

David Suzanne (dAs)

ECHU.ORG is not responsible for the misuse of the information we 
provide through our security advisories. These advisories are a 
service to the professional security community. In no event shall 
ECHU.ORG be liable for any consequences whatsoever arising out of 
or in connection with the use or spread of this information.

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH