This site runs with your support. Please donate:
Evaders Squadron Coding [ESC] :: View topic - Security: PHP-Nuke "lang" Local File Inclusion Vul
View previous topic :: View next topic
Author
Message
Evaders99 Joined: Jan 11, 2002 Posts: 3079 Location: USA
Posted: Mon Mar 12, 2007 11:57 pm Post subject: Security: PHP-Nuke "lang" Local File Inclusion Vul
In response to this:
http://secunia.com/advisories/24484/
I am posting my own analysis here:
This was already fixed in Patched files 7.8 and lower. RavenNuke is fine.
Patched 7.9 and 8.0 may be vulnerable and I will report this to chatserv.
Solution: Upgrade to the latest Patched / Don't use 7.9 or 8.0 _________________Evaders99
Webmaster
Administrator
Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -
The cake is a lie.
Back to top
Evaders99 Joined: Jan 11, 2002 Posts: 3079 Location: USA
Posted: Fri Jun 19, 2009 12:24 am Post subject:
In response to one posted 5/14/2009
http://gsasec.blogspot.com/2009/05/php-nuke-v80-directory-traversal_14.html
This does not seem to be an issue, rather a duplicate.
I am posting an addendum, since these don't seem to be in the 7.9/8.0/8.1 Patched files. All others Patched versions / RavenNuke are fine.
For those using 7.9 or 8.0 Patched 3.5
Code:
in mainfile.php
FIND
} elseif (isset($lang)) {
$lang = filter($lang, "nohtml");
REPLACE WITH
} elseif ((isset($lang)) AND (!stristr($lang,"."))) {
$lang = filter($lang, "nohtml");
For those using 8.1 (Patched or original, as patched does not modify mainfile.php)
Code:
in mainfile.php
FIND
if (!defined('FORUM_ADMIN')) {
if ((isset($newlang)) AND (stristr($newlang,"."))) {
if (file_exists("language/lang-".$newlang.".php")) {
setcookie("lang",$newlang,time()+31536000);
include_once("language/lang-".$newlang.".php");
$currentlang = $newlang;
} else {
setcookie("lang",$language,time()+31536000);
include_once("language/lang-".$language.".php");
$currentlang = $language;
}
} elseif (isset($lang)) {
include_once("language/lang-".$lang.".php");
$currentlang = $lang;
} else {
setcookie("lang",$language,time()+31536000);
include_once("language/lang-".$language.".php");
$currentlang = $language;
}
}
REPLACE WITH
if (!defined('FORUM_ADMIN')) {
if ((isset($newlang)) AND (stristr($newlang,"."))) {
$newlang = filter($newlang, "nohtml");
if (file_exists("language/lang-".$newlang.".php")) {
setcookie("lang",$newlang,time()+31536000);
include_once("language/lang-".$newlang.".php");
$currentlang = $newlang;
} else {
setcookie("lang",$language,time()+31536000);
include_once("language/lang-".$language.".php");
$currentlang = $language;
}
} elseif ((isset($lang)) AND (!stristr($lang,"."))) {
$lang = filter($lang, "nohtml");
include_once("language/lang-".$lang.".php");
$currentlang = $lang;
} else {
setcookie("lang",$language,time()+31536000);
include_once("language/lang-".$language.".php");
$currentlang = $language;
}
}
_________________Evaders99
Webmaster
Administrator
Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -
The cake is a lie.
Back to top
stevenswing Newbie Joined: Oct 09, 2009 Posts: 5
Posted: Fri Oct 09, 2009 12:01 am Post subject:
Does this code look vulnerable?:
Code:
if ($forum_admin != 1) {
if (isset($newlang) AND !eregi("\.","$newlang")) {
if (file_exists("language/lang-$newlang.php")) {
setcookie("lang",$newlang,time()+31536000);
include("language/lang-$newlang.php");
$currentlang = $newlang;
} else {
setcookie("lang",$language,time()+31536000);
include("language/lang-$language.php");
$currentlang = $language;
}
} elseif (isset($lang)) {
include("language/lang-$lang.php");
$currentlang = $lang;
} else {
setcookie("lang",$language,time()+31536000);
include("language/lang-$language.php");
$currentlang = $language;
}
}
Back to top
Evaders99 Joined: Jan 11, 2002 Posts: 3079 Location: USA
Back to top
stevenswing Newbie Joined: Oct 09, 2009 Posts: 5
Posted: Fri Oct 09, 2009 1:37 am Post subject:
We have a very heavily modified version of nuke, with lots and lots of customizations.
What would the patch for this be?
Thank you for your help.
Back to top
Evaders99 Joined: Jan 11, 2002 Posts: 3079 Location: USA
Posted: Fri Oct 09, 2009 1:47 am Post subject:
This should work
Code:
if ($forum_admin != 1) {
if (isset($newlang) AND !eregi("\.","$newlang")) {
if (file_exists("language/lang-$newlang.php")) {
setcookie("lang",$newlang,time()+31536000);
include("language/lang-$newlang.php");
$currentlang = $newlang;
} else {
setcookie("lang",$language,time()+31536000);
include("language/lang-$language.php");
$currentlang = $language;
}
} elseif ((isset($lang)) AND (!stristr($lang,"."))) {
$lang = check_html($lang, "nohtml");
include("language/lang-$lang.php");
$currentlang = $lang;
} else {
setcookie("lang",$language,time()+31536000);
include("language/lang-$language.php");
$currentlang = $language;
}
}
_________________Evaders99
Webmaster
Administrator
Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -
The cake is a lie.
Back to top
stevenswing Newbie Joined: Oct 09, 2009 Posts: 5
Posted: Fri Oct 09, 2009 5:16 am Post subject:
Thank you for the patch, appreciated. Where is the best place to stay current with PHP-Nuke vulnerabilites?
Back to top
Evaders99 Joined: Jan 11, 2002 Posts: 3079 Location: USA
Posted: Fri Oct 09, 2009 7:11 pm Post subject:
I post what I find on Nukecops.com - although most of the Nuke sites are now dead anyway. _________________Evaders99
Webmaster
Administrator
Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -
The cake is a lie.
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group