Potablog 1338.at Header

 
SQL-Injection, XSS (Cross-Site-Scripting) oder Session Hijacking sind den meisten Leuten die sich mit der Entwicklung und Sicherheit von (Web)-Applikationen beschäftigen sicherlich ein Begriff.
Doch auch anders können sich bösartige Lücken in Quelltexten auftun.

Stefan Esser schreibt auf seinem Blog Suspekt...A Blog About Code, Information Security, PHP And More über eine Schwachstelle die sich da SQL Column Truncation Vulnerabilities nennt.

Dabei wird ausgenutzt, dass ein String der mehr Zeichen hat als für ein bestimmtes Feld erlaubt sind, einfach beim Zeichenlimit abgeschnitten werden. Somit wird es möglich, dass zb ein Benutzer "admin" und ein Benutzer "admin " in der gleichen Spalte existieren, obwohl beim erstellen des 2. Benutzers eine Abfrage getätigt wurde, ob der Benutzer schon vorhanden sei.
Zitat...
Because MySQL does not compare strings in binary mode by default more relaxed comparison rules are used. One of these relaxations is that trailing space characters are ignored during the comparison. This means the string 'admin ' is still equal to the string 'admin' in the database. And therefore the application will refuse to accept the new user.

If the attacker however tries the username 'admin x' the application will search for it in the database and will not find it, because it is impossible to find a username with a length of 17 in a database field that has a 16 character limit. The application will accept the new username and insert it into the database. However the username column is to short for the full name and therefore it is truncated and 'admin ' is inserted into the database.

The result of this is that the user table now contains two users that due to trailing spaces both will be returned when the SELECT query above is executed. At this point a potential security problem arises because now it depends on how the username is treated throughout the application. The following pseudocode for example is vulnerable.
...


Mehr davon auf www.suspekt.org

Sehr empfehlenswert!
Direktlink  Kommentare: 0 geschrieben von potassium am Dienstag, 09.09.2008, 23:11

Kommentar(e):
Es wurden noch keine (öffentlichen) Kommentare eingetragen.

Kommentar hinzufügen

Name*:
E-Mail-Adresse*: (Wird nicht veröffentlicht!)
WWW:


Text *:

HTML ist in den Kommentaren deaktiviert, alternativ können Sie aber (ausgewählte) bbCode-Befehle benutzen.

Privater Kommentar (Ist nur für den Autor des Eintrags lesbar.)
Benachrichtige mich, wenn es Antworten auf meinen Kommentar gibt.
Meine Eingaben merken.

Bitte geben Sie folgenden Antibot-Code ein:
Auth-Code
Antibot-Code*: