[UNIX] QwikAd Allows Malicious SQL Code Injection

From: support@securiteam.com
Date: 12/27/01


From: support@securiteam.com
To: list@securiteam.com
Date: Thu, 27 Dec 2001 08:18:57 +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.
- - - - - - - - -

  QwikAd Allows Malicious SQL Code Injection
------------------------------------------------------------------------

SUMMARY

 <http://virusexperts.com/qwikad.php> QwikAd is software written in Perl,
which uses DBI with MySQL driver to access database. A security
vulnerability in the product allows remote attackers to insert malicious
SQL statements into existing ones.

DETAILS

Vulnerable systems:
QwikAd version 1.0

QwikAd script:
Many values provided by client used in the SQL statements go through
'stripBad' filter, however the author of the program forget that
HTTP_REFERER data values that comes client can also contain malicious
code, and if it used inside an SQL statement (as in the case of QwikAd),
an attacker Can cause the program to execute malicious code.

Publishers script:
This is vulnerability best illustrated by the following example:

} elsif($cgi->param('action') eq 'exclude' && $cgi->param('exclude')) {
 my $id = $cgi->param('exclude');
 my ($ids) = query("SELECT exclude FROM publishers WHERE user='$user'");
 if($ids =~ /$id/) {
   $ids =~ s/,$id//;
   $ids =~ s/$id,//;
 } else {
   $ids .= ",$id";
 }
 my @ids = split(',', $ids);
 my $where = "UPDATE LOW_PRIORITY publishers SET exclude='";
 foreach(@ids) {
   $where .= "$_,";
 }
 $where =~ s/,$//;
 $where .= "' WHERE user='$user'";
 my $sth = $dbh->prepare($where);

The call to 'stripBad' filter has been obviously omitted here.

ADDITIONAL INFORMATION

The information has been provided by <mailto:GOBBLES@hushmail.com>
GOBBLES LABS.

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

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.



Relevant Pages

  • SecurityFocus Microsoft Newsletter #165
    ... Tenable Security ... distribute, manage, and communicate vulnerability and intrusion detection ... Microsoft Internet Explorer MHTML Forced File Execution Vuln... ...
    (Focus-Microsoft)
  • SecurityFocus Microsoft Newsletter #174
    ... This issue sponsored by: Tenable Network Security ... the worlds only 100% passive vulnerability ... MICROSOFT VULNERABILITY SUMMARY ... Novell Netware Enterprise Web Server Multiple Vulnerabilitie... ...
    (Focus-Microsoft)
  • [NT] Cumulative Security Update for Internet Explorer (MS04-038)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Get your security news from a reliable source. ... CSS Heap Memory Corruption Vulnerability, ... Microsoft Windows NT Server 4.0 Terminal Server Edition Service Pack 6 ...
    (Securiteam)
  • SecurityFocus Microsoft Newsletter #171
    ... Better Management for Network Security ... GoodTech Telnet Server Remote Denial Of Service Vulnerabilit... ... ASPApp PortalAPP Remote User Database Access Vulnerability ...
    (Focus-Microsoft)
  • SecurityFocus Microsoft Newsletter #160
    ... MICROSOFT VULNERABILITY SUMMARY ... Geeklog Forgot Password SQL Injection Vulnerability ... Atrium Software Mercur Mailserver IMAP AUTH Remote Buffer Ov... ... Sun Java Virtual Machine Slash Path Security Model Circumven... ...
    (Focus-Microsoft)