Exploit-DB #19598
Description: Freeside SelfService CGI/API 2.3.3 - Multiple Vulnerabilities
Type: webapps
Platform: php
Date: 2012-07-05
Author: Vulnerability-Lab

Exploit:
Title:
======
Freeside SelfService CGI|API 2.3.3 - Multiple Vulnerabilities


Date:
=====
2012-06-14


References:
===========
http://www.vulnerability-lab.com/get_content.php?id=614


VL-ID:
=====
614


Common Vulnerability Scoring System:
====================================
6.5


Introduction:
=============
Billing, ticketing, reporting and configuration for employees and resellers The majority of Freeside s 
functionality is accessed from here. The back office interface includes searching and viewing of customers, 
invoices, trouble tickets and services, as well as reporting, configuration, per-user access control, 
resellser virtualization and more.

(Copy of the Vendor Homepage: http://freeside.biz/freeside )


Abstract:
=========
The Vulnerability Laboratory Research Team discovered multiple web vulnerabilities in Freesides SelfService CGI|API v2.3.3 git.


Report-Timeline:
================
2012-06-14:	Public or Non-Public Disclosure


Status:
========
Published


Affected Products:
==================
Freeside
Product: SelfService CGI|API v2.3.3


Exploitation-Technique:
=======================
Remote


Severity:
=========
High


Details:
========
1.1
Multiple SQL Injection vulnerabilities are detected in Freesides SelfService CGI|API v2.3.3.
The vulnerability allows an attacker (remote) or local low privileged user account to inject/execute own 
sql commands on the affected application dbms without user inter action. The vulnerability is located in the 
selfservice.cgi and the bound parameters action & svcnum. Successful exploitation of the vulnerability 
results in dbms & application compromise.


Vulnerable Module(s):
                          [+] View my usage - Service usage details 

Vulnerable File(s):
                          [+] selfservice.cgi

Vulnerable File(s):
                          [+] svcnum
                          [+] action


1.2
Multiple persistent input validation vulnerabilities are detected in Freesides SelfService CGI|API v2.3.3.
The bugs allow remote attackers to implement/inject malicious script code on the application side (persistent). 
The persistent vulnerabilities are located in the cust_main.cgi, part_pkg.cgi, part_event.html or part_device.html 
with the bound parameters company address, package comment, event- & device name. Exploitation requires low user 
inter action & privileged application user account. Successful exploitation of the vulnerability can lead to 
session hijacking (admin) or stable (persistent) context manipulation. 

Vulnerable Files(s):
                          [+] ../edit/cust_main.cgi?426
                          [+] ../edit/part_pkg.cgi?4
                          [+] ../browse/part_event.html
                          [+] ../browse/part_device.html

Vulnerable Module(s):
                          [+] [Company] [Address]
                          [+] [Package] [Comment]
                          [+] [Event Name]
                          [+] [Device Name]



1.3
Multiple non persistent cross site scripting vulnerabilities are detected in Freesides SelfService CGI|API v2.3.3.
The vulnerability allows remote attackers to hijack website customer, moderator or admin sessions with high required 
user inter action or local low privileged user account. The vulnerabilities are located in the selfservice.cgi file 
with the vulnerable bound parameters pkg, pkgnum, beginning & end. Successful exploitation can result in account steal, 
phishing & client-side content request manipulation. 

Vulnerable Module(s):
                          [+] Change User Details
                          [+] Change Package

Vulnerable File(s):
                          [+] selfservice.cgi


Vulnerable Parameter(s):
                          [+] pkg & pkgnum
                          [+] end & beginning


Proof of Concept:
=================
1.1
The sql injection vulnerability can be exploited by remote attackers without privileged user account or user inter action.
For demonstration or reproduce ...

PoC:
../selfserv/selfservice.cgi?session=8cd42b35567e5bdce44bf17779b6431e;action=view_usage_details;svcnum=-1'[SQL-INJECTION];beginning=0;ending=0
../selfserv/selfservice.cgi?session=8cd42b35567e5bdce44bf17779b6431e;action=view_usage_details[SQL-INJECTION];svcnum=X;beginning=0;ending=0

> "SELECT * FROM svc_acct WHERE svcnum = ?": LINE 1: SELECT * FROM svc_acct WHERE svcnum = $1

Note: First get a alive session, exchange it with the expired of the poc and then try to access the url to inject your sql commands.


1.2
The persistent input validation vulnerabilities can be exploited by remote attackers with low required user inter action.
For demonstration or reproduce ...

Example:
The attacker create/edit an account and inject a malicious script code i.e., <iframe src=www.vuln-lab.com onload=alert("VL")></iframe> 
in the vulnerable fields which are Company and Address. This bug is very dangerous because once the admin enters the admin area 
he will see the page of users. The code that we injected will be executed out of the main page context of the admin.


Review: Payname

<font color="#FF0000">Illegal (name) (error code illegal_name) payname: 
"><iframe src="selfservice.cgi-Dateien/a.xht" onload='alert("VL")' <<="" font="">
</FONT><BR><BR>


Review: Faxname

<font color="#FF0000">Illegal (phone) (error code illegal_phone) fax: "
><iframe src="selfservice2.cgi-Dateien/a.htm" onload='alert("VL")' <<="" font=""><
/FONT><BR><BR>


Review: Username

username) (2-32): "><iframe src="selfservice3.cgi-Dateien/a.htm" onload='alert("VL</FONT'>
</FONT><BR><BR>
<FORM
NAME="OrderPkgForm" 


1.3
The non persistent cross site scripting vulnerabilities can be exploited by remote attackers with medium or high required user
inter action & without local privileged user account. For demonstration