4images Help / Hilfe > Bug Fixes & Patches

[1.7 - 1.7.8] Security fix for CSRF vulnerability

(1/5) > >>

kai:
A cross-site request forgery vulnerability in 4images 1.7 - 1.7.8 has been found.

To fix this please follow these 4 steps:

1.
Download the attached file csrf_utils.php file and copy it into includes/ folder of your 4images installation.


2.
Open global.php and search for the following line:

@include(ROOT_PATH.'config.php');

and insert the following code ABOVE this line:

// Initialize CSRF protection configuration
$csrf_protection_enable      = 1;
$csrf_protection_frontend    = 1;
$csrf_protection_backend     = 1;
$csrf_protection_expires     = 7200;
$csrf_protection_name        = '__csrf';
$csrf_protection_xhtml       = 1;

In the same file, search for the line:

include_once(ROOT_PATH.'includes/captcha_utils.php');

and insert the following code BELOW this line:

//-----------------------------------------------------
//--- CSRF protection ---------------------------------
//-----------------------------------------------------
include_once(ROOT_PATH.'includes/csrf_utils.php');


3.
Open includes/page_header.php and search for the following line (at the end for the file):

?>

and insert the following code ABOVE this line:

if ($csrf_protection_enable && $csrf_protection_frontend) {
  csrf_start(true);
}


4.
Open admin/admin_global.php and search for the following line:

include_once(ROOT_PATH.'admin/admin_functions.php');

and insert the following code BELOW this line:

if ($csrf_protection_enable && $csrf_protection_backend) {
  csrf_start();
}



Thanks to Russ McRee for finding and reporting this vulnerability!

Jan-Lukas:
seit ich das eingebaut habe, klappt die Suche nicht mehr von außerhalb der Galerie.
bekomme dann die Fehlermeldung

CSRF check failed.

Zur Erklärung, habe auf einer anderen Seite eine Suchbox installiert, die zu 4images führt, und bis zu diesem update auch geklappt hat.
http://www.ue-ei-portal.de

Die Suche auf 4images klappt natürlich weiterhin

LG

Rembrandt:

--- Quote from: Hagen-Roderich on October 27, 2010, 05:52:41 PM ---Seit dem Update bekomme ich beim Aufruf folgende Fehlermeldung (wenn keine &sessionid=*** vorhanden ist):
...
Wie kann ich die Fehlermeldung wieder abstellen?

--- End quote ---
im moment funktioniert deine seite...

ich pers. habe heute bei 4 galerien das "fix" eingebaut und nirgends gab es probleme..

Hagen-Roderich:
Ja, Seite funktioniert wieder  :D

Ich habe mir mal die Fehlermeldung durchgelesen und dann die Zeile 249 in der "csrf_utils.php" angeschaut.
Da waren bei mir zwei Leerzeilen hinter "?>".

Danke das Du dir die Zeit dafür genommen hast.

Jan-Lukas:
das Problem kann ich auch nicht bestätigen, und Session ID's werden bei mir auch nicht angezeigt.
Kannst Du denn mal eine externe suche testen ?

Navigation

[0] Message Index

[#] Next page

Go to full version