Authentication bypass in phpBannerExchange
RedTeam identified two SQL injections in phpBannerExchange. It is
possible to bypass user authentication with them.
Affected Versions: All versions up to phpBannerExchange 2.0 RC5
Fixed Versions: 2.0 RC6
Vulnerability Type: SQL injections
Vendor-Status: informed, fixed version released
From the vendor's homepage:
phpBannerExchange is a PHP/mySQL script that allows virtually anyone
with minimal knowledge of PHP, mySQL and web hosting to run their own
In file "client/stats.php" the variables $login and $pass are not
sanitized at all.
If plaintext password are allowed ($usemd5 != "Y"), following SQL query
59 $result = mysql_query("select * from banneruser where
login='$login' AND pass='$pass'");
By passing the special character "'" it is possible to alter the SQL
query and bypass authentication.
A similar vulnerability exists in "admin/stats.php":
54 $result = mysql_query("select * from banneradmin where
Proof of Concept
User login or administrator login:
Use "'or''='" for both login name and password. You will be
authenticated as the first user/admin in the database.
Use PHP Magic Quotes.
Upgrade to version 2.0 RC6
The security risk is high because an attacker could gain access to an
administrator account and view and alter the database and hereby
compromise the whole application.
2006-06-09 Discovery of the problem
2006-06-10 Vendor is informed
2006-06-12 Vendor releases fixed version
2006-06-15 Advisory released
2009-05-08 Updated Advisory URL
RedTeam Pentesting offers individual penetration tests, short pentests,
performed by a team of specialised IT-security experts. Hereby, security
weaknesses in company networks are uncovered and can be fixed
As there are only few experts in this field, RedTeam wants to share its
knowledge and enhance the public knowledge with research in security
related areas. The results are made available as public security
More information about RedTeam can be found at