what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

4images 1.7.12 Cross Site Scripting

4images 1.7.12 Cross Site Scripting
Posted Dec 9, 2015
Authored by Tim Coen | Site curesec.com

4images version 1.7.12 suffers from a cross site scripting vulnerability.

tags | exploit, xss
SHA-256 | e29705c77e725464b6e9ceec32238f33b46902963af3d0422c3583435a6b0654

4images 1.7.12 Cross Site Scripting

Change Mirror Download
Security Advisory - Curesec Research Team

1. Introduction

Affected Product: 4images 1.7.12
Fixed in: 1.7.13 (update)
Fixed Version Link: http://www.4homepages.de/download-4images
Vendor Website: http://www.4homepages.de/
Vulnerability Type: XSS
Remote Exploitable: Yes
Reported to vendor: 09/29/2015
Disclosed to public: 12/02/2015
Release mode: Coordinated release
CVE: Requested, but not assigned
Credits Tim Coen of Curesec GmbH

2. Overview

There are two reflected XSS vulnerabilities in 4images, as well as a persistent
Open Redirect, which may also lead to XSS in older browsers.

This allows an attacker to execute arbitrary JavaScript in the context of the
browser of a victim if the victim clicks on an attacker supplied link or visits
an attacker controlled website. With this, it is possible to bypass CSRF
protection and thus do anything the victim can do, inject a JavaScript
keylogger, or perform phishing attacks.

It should be noted that the XSS vulnerability still existed in another form in
the first release of version 1.17.13 and has been fixed with an update to that
version.

3. Reflected XSS 1

CVSS

Medium 4.3 AV:N/AC:M/Au:N/C:N/I:P/A:N

Description

When displaying the form to add new images, $_SERVER['PHP_SELF'] is echoed
unencoded inside a select tag. Because of this, additional attributes can be
added and new HTML tags can be created, leading to XSS.

Proof of Concept

Prior to Version 1.7.12:


http://localhost/4images/admin/images.php/" onfocus=alert(1) autofocus foo="?action=addimages

Version 1.7.13 (before update):


http://localhost/4images/admin/images.php/');alert(1);window.location=('?action=addimages

This required a click of the victim to trigger, and a redirect will be
performed after the execution of the injected code.

Code


/admin/images.php
show_num_select_row(" ", "num_newimages", $lang['num_addnewimages_desc']);

/admin/admin_functions.php
function show_num_select_row($title, $option, $desc = "") {
global $site_sess, $PHP_SELF, $action, $$option;
echo "<tr class=\"".get_row_bg()."\">\n<td><p>".$title."</p></td>\n";
echo "<td align=\"right\"><p>".$desc;
$url = $PHP_SELF;
$url .= preg_match("/\?/", $url) ? "&" : "?";
$url .= "action=".$action;
$url = $site_sess->url($url);
echo "<select name=\"num\" onchange=\"window.location=('".$url."&";
echo $option."='+this.options[this.selectedIndex].value)\">\n";
for ($i = 1; $i < 11; $i++) {
echo "<option value=\"$i\"";
if ($i == ${$option}) {
echo " selected";
}
echo ">".$i."</option>\n";
}
echo "</select></p></td>\n</tr>\n";
}

4. Reflected XSS 2

CVSS

Medium 4.3 AV:N/AC:M/Au:N/C:N/I:P/A:N

Description

User input is echoed inside the src attribute of a frame, which makes it
possible to execute javascript.

Proof of Concept


http://localhost/4images/admin/index.php?goto=javascript:alert%281%29

Code


/admin/index.php
if ($action == "") {
$action = "frames";
}

if ($action == "frames") {
if ($goto != "" && strpos($goto, '://') === false) {
$framesrc = $site_sess->url($goto);
}
else {
$framesrc = $site_sess->url("home.php");
}
?>
<html dir="<?php echo $lang['direction']; ?>">
<head>
<title><?php echo $config['site_name']; ?> Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['charset']; ?>">
</head>
<frameset rows="70,*" framespacing="0" border="0" frameborder="0" frameborder="no" border="0">
<frame src="<?php echo $site_sess->url("index.php?action=head"); ?>" name="head" scrolling="NO" NORESIZE frameborder="0" marginwidth="0" marginheight="0" border="no">
<frameset cols="216,*" framespacing="0" border="0" frameborder="0" frameborder="no" border="0">
<frame src="<?php echo $site_sess->url("index.php?action=nav"); ?>" name="nav" scrolling="auto" NORESIZE frameborder="0" marginwidth="0" marginheight="0" border="no">
<frame src="<?php echo $framesrc ?>" name="main" scrolling="auto" NORESIZE frameborder="0" marginwidth="20" marginheight="20" border="no">
</frameset>
</frameset>
</html>

5. Persistent Open Redirect

CVSS

Medium 4.3 AV:N/AC:M/Au:N/C:N/I:P/A:N

Description

When showing an uploaded image, the description and keyword are not properly
encoded. Tags are removed, but it is still possible to add further attributes
to the meta tag they are inserted into.

This makes it possible to inject a redirect. This redirect will be persistent,
meaning anyone visiting the site of the uploaded image will be redirected to an
attacker controlled website.

The attacker needs the rights to upload images to perform the attack, which
means that a category needs to exist where anyone can upload images, or a
category needs to exist where registered users can upload images and the
registration must be open - which it is by default.

Proof of Concept

Upload an image, as description or keyword use:

Version 1.7.11 and earlier:
5;URL=http://google.com/" http-equiv="refresh" foo="
Version 1.7.12:
5;URL=http://google.com/" http-equiv=refresh foo="

When visiting the page of the uploaded image, a redirect will be performed.

With older browsers, it will be possible to inject and execute javascript as
well.

Code


details.php
$meta_keywords = !empty($image_row['image_keywords']) ? strip_tags(implode(", ", explode(",", $image_row['image_keywords']))) : "";
$meta_description = !empty($image_row['image_description']) ? strip_tags($image_row['image_description']) . ". " : "";

$site_template->register_vars(array(
"detail_meta_description" => $meta_description,
"detail_meta_keywords" => $meta_keywords,
"prepend_head_title" => $image_name . " - ",
));

6. Solution

To mitigate this issue please upgrade at least to version 1.7.13:

http://www.4homepages.de/download-4images

Please note that a newer version might already be available.

7. Report Timeline

09/29/2015 Informed Vendor about Issue
10/21/2015 Reminded Vendor of Disclosure Date
11/03/2015 Vendor releases new version (1.7.12), partially fixing issues
11/17/2015 CVE Requested (no reply)
11/18/2015 Vendor releases new version (1.7.13), partially fixing issues
11/23/2015 Vendor releases update to version 1.7.13, fixing the issues
12/02/2015 Disclosed to public


Blog Reference:
https://blog.curesec.com/article/blog/4images-1712-XSS-110.html

--
blog: https://blog.curesec.com
tweet: https://twitter.com/curesec

Curesec GmbH
Curesec Research Team
Romain-Rolland-Str 14-24
13089 Berlin, Germany


Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    53 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close