[NEWS] Ikonboard Cookie Filter Vulnerability

From: support@securiteam.com
Date: 11/05/01


From: support@securiteam.com
To: list@securiteam.com
Subject: [NEWS] Ikonboard Cookie Filter Vulnerability
Message-Id: <20011105075327.64670138BF@mail.der-keiler.de>
Date: Mon,  5 Nov 2001 08:53:27 +0100 (CET)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  Ikonboard Cookie Filter Vulnerability
------------------------------------------------------------------------

SUMMARY

 <http://www.ikonboard.com/> Ikonboard is a widely used web BBS program
written in Perl. The program contains a security vulnerability that allows
remote attackers to get administrative privileges. In some environments,
an attacker may gain a 'nobody' shell.

DETAILS

Vulnerable systems:
Ikonboard ib219 and all older versions

File:Search.cgi
---[L.55-56]---
$inmembername = cookie("amembernamecookie");
$filename = $inmembername;
---

As we can see, $inmembername is variable used to store the cookie
'amembernamecookie'
---[L.66-]---
$searchfilename = "$ikondir" . "search/$filename";
---

---[L.124-131]---
    open (SEARCH, ">$searchfilename") or die "Cannot save to the search
folder";
    print SEARCH "$CUR_TIME\n";
    print SEARCH "$SEARCH_STRING\n";
    print SEARCH "$TYPE_OF_SEARCH\n";
    print SEARCH "$REFINE_SEARCH\n";
    print SEARCH "$FORUMS_TO_SEARCH\n";
    close (SEARCH);
---

---
It sets the filename, runs it through the filter, and opens it.

The variable $filename come from Cookie amembernamecookie that does not
filter out "..". An attacker can sent a fake cookie("amembernamecookie"),
setup or edit an existing file on the system. This means an attacker can
write any content to any file and gain the BBS administrative privileges.

On UNIX like system, if your system is PHP enabled, you can upload a PHP
based shell.

Workaround:
1. Modify the file Search.cgi and change line 56:
$inmembername =~ s/\///g;
To:
$inmembername =~ s/\.\.//g;

ADDITIONAL INFORMATION

The information has been provided by <mailto:chenjun@netguard.com.cn>
Chen Jun.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.