Author Topic: Secunia: 4images "template" Parameter File Inclusion Vulnerability  (Read 5673 times)

0 Members and 1 Guest are viewing this topic.

Offline arhimede

  • Pre-Newbie
  • Posts: 2
    • View Profile
[removed] there is a fix for this exploit ? Thanks
« Last Edit: February 28, 2006, 02:40:50 PM by V@no »

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: Secunia: 4images "template" Parameter File Inclusion Vulnerability
« Reply #1 on: February 27, 2006, 08:56:20 PM »
hmmm, i tried it and unfortunatley it worked,
and it's an great security hole.

with the backdoor it's possible to execute command line commands.

A first fix would be:
in index.php find:
Code: [Select]
  $template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));

and replace with:
Code: [Select]
  $template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));
  // Security Fix
  $patterns = array("/(\/)/","/(%2F)/");
  $template = preg_replace ($patterns,"",$template);
  // Security Fix


One user already told that he was hacked,
maybe through this exploit.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Secunia: 4images "template" Parameter File Inclusion Vulnerability
« Reply #2 on: February 28, 2006, 02:41:57 PM »
I've removed the link for security reason
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)