SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Forum/Board/Portal)  >   contentNow Vendors:   contentnow.mf4k.de
contentNow Input Validation Flaw in 'pageid' Parameter Lets Remote Users Inject SQL Commands
SecurityTracker Alert ID:  1017265
SecurityTracker URL:  http://securitytracker.com/id/1017265
CVE Reference:   CVE-2006-6157   (Links to External Site)
Updated:  May 27 2008
Original Entry Date:  Nov 21 2006
Impact:   Disclosure of system information, Disclosure of user information, User access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  Exploit Included:  Yes  
Version(s): 139 and prior versions
Description:   A vulnerability was reported in contentNow. A remote user can inject SQL commands.

The 'index.php' script does not properly validate user-supplied input in the 'pageid' parameter. A remote user can supply a specially crafted parameter value to execute SQL commands on the underlying database.

A remote user can also exploit this to determine the installation path.

A demonstration exploit is available at:

http://www.0xcafebabe.it/sploits/contentnow_139_sqlinj.pl

The vendor was notified on November 20, 2006.

Revenge reported this vulnerability.

Impact:   A remote user can execute SQL commands on the underlying database.
Solution:   The vendor has issued a fixed version (140 and later), available at:

http://sourceforge.net/projects/contentnow/

The contentNow advisory is available at:

http://sourceforge.net/project/shownotes.php?group_id=161604&release_id=465437

Vendor URL:  www.contentnow.mf4k.de/ (Links to External Site)
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.


 Source Message Contents

Subject:  ContentNow CMS 1.39 Sql Injection + Path Disclosure Vulnerabilities

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ContentNow CMS 1.39 'pageid' Sql Injection + Path Disclosure

Severity : Medium Risk
Vendor   : http://www.contentnow.mf4k.de/
Author	 : Revenge

[--------------------------------------------------]

[#] Description

ContentNow is a PHP Content Management System web 2.0 compliant, more
info can be found at vendor site.

ContentNow v1.39 is vulnerable to a sql injection and path disclosure.

[--------------------------------------------------]

Vuln #1  : Sql Injection
Impact   : Admin credentials disclosure
Exploit  : http://www.0xcafebabe.it/sploits/contentnow_139_sqlinj.pl
(Works regardless of magic quotes)

The "pageid" parameter in "index.php" isn't properly sanitised before
being used in a sql query, this can be exploited to manipulate existing
SQL query by inserting arbitrary SQL code, which can disclose sensitive
information like admin credentials.

The problem is due to:
[ index.php ]
...
...
// get/set id or startpageid from config
  -->   $pid = $_GET['pageid'];
        if (empty($pid) || $pid == 1) $pid =
$cnEngine->configArray[0]['startpageid'];

  -->   if (false == $cnEngine->checkPid($pid)) die ('<span
style="font:13px sans-serif;">Error loading site. No pid found.</span>');

        $cnEngine->setId($pid);
...
...

[ function checkPid($pid) and getActualContent($param) from
/cn/library/class.engine.php ]
...
...
function checkPid($pid) {
                $cnDatabase = NewADOConnection(ADODB_DB_TYPE);
                $cnDatabase->Connect(CN_DB_HOST, CN_DB_USER,
CN_DB_PASSWORD, CN_DB_NAME);
                $sql = "SELECT pageid FROM ".CN_TBL_SECTIONS." WHERE
pageid = ".$pid;
                $res = $cnDatabase->Execute($sql);
                if ($res->RecordCount() > 0) {
                        return true;
                } else {
                        return false;
                }
        }
...
...

function getActualContent($param = '') {
                $cnDatabase = NewADOConnection(ADODB_DB_TYPE);
                $cnDatabase->Connect(CN_DB_HOST, CN_DB_USER,
CN_DB_PASSWORD, CN_DB_NAME);
                $sql = "SELECT ".TABLE_FIELDS_CONTENT." FROM
".CN_TBL_CONTENT.$this->contentLanguageSuffix." WHERE pid =
".$this->pageid." AND deleted = 0 ".$param." ORDER by sort ASC";
                $res = $cnDatabase->Execute($sql);
                if ($res->RecordCount() > 0) {
                        while ($row = $res->FetchRow()) {
                                $row['contenttitle'] =
stripslashes($row['contenttitle']);
                                $row['contentsyskey'] =
stripslashes($row['contentsyskey']);
                                $row['contentsubtitle'] =
stripslashes($row['contentsubtitle']);
                                $row['content'] =
str_replace('\"','"',$row['content']);
                                $contentArray[] = $row;
                        }
                }
                $this->contentArray = $contentArray;
                return $contentArray;
        }

As you can see there's no input validation on "pageid" parameter.

Vuln #2: It is also possible to disclose the full path to index.php by
requesting index.php?pageid='

[--------------------------------------------------]

[#] Solution

Download 1.40 version.

[#] Disclosure timeline

2006/11/20 Bug discovered
2006/11/20 Vendor contacted
2006/11/21 Vendor response
2006/11/21 New version 1.40 released
2006/11/21 Public Disclosure

Revenge

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFY0nJcLZvqfjeuvcRAlguAJ49Bdab5lNyX69OYmxIuzOb2yjvPwCcCq2+
OCNrT290ArsWjsqKG/Lk+OM=
=ICDL
-----END PGP SIGNATURE-----

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, SecurityGlobal.net LLC