4images Forum & Community
4images Help / Hilfe => Bug Fixes & Patches => Topic started by: kai on October 27, 2010, 12:10:43 PM
-
A cross-site request forgery (http://en.wikipedia.org/wiki/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 (http://www.4homepages.de/forum/index.php?action=dlattach;topic=28168.0;attach=5901) 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 (http://holisticinfosec.org/) for finding and reporting this vulnerability!
-
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
-
Seit dem Update bekomme ich beim Aufruf folgende Fehlermeldung (wenn keine &sessionid=*** vorhanden ist):
...
Wie kann ich die Fehlermeldung wieder abstellen?
im moment funktioniert deine seite...
ich pers. habe heute bei 4 galerien das "fix" eingebaut und nirgends gab es probleme..
-
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.
-
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 ?
-
Diese auch nicht, gehe davon aus das keine funktionieren
Image Group
Data Backup
Rebuild Thumbnails
Shoutbox Admin
-
...
Image Group
...
meinst du meine mod?
-
jep
wenn ich im Admin die ID aufrufe, kommt die Meldung
-
ahjo.. so ein schmorn...
ich habe in der global.php das mal auf "0" gesetzt:
$csrf_protection_backend = 0;
aber es wird sicher noch eine lösung dafür geben...
mfg Andi
-
damit klappen die internen, bei externen (meine suche)
habe ich noch $csrf_protection_frontend = 0; auf null gestellt.
Hoffe das kai was findet
-
ahjo.. so ein schmorn...
ich habe in der global.php das mal auf "0" gesetzt:
$csrf_protection_backend = 0;
aber es wird sicher noch eine lösung dafür geben...
mfg Andi
Hi Andi,
schaltet das den ganzen Schutz ab?
Gruß Jens
-
nein, wenn du das auf 0 stellst, ist alles aus
$csrf_protection_enable = 1;
-
Ich habe die csrf_utils.php im Hauptpost aktualisiert. Bitte ersetzt die aktuelle mit dieser, dann sollten auch die Plugins wieder funktionieren.
Zu den Konfigurationsvariablen:
$csrf_protection_enable = 1;
Dies auf 0 gesetzt, schaltet den Schutz komplett aus (für Frontend und Backend).
$csrf_protection_frontend = 1;
Dies auf 0 gesetzt, schaltet den Schutz komplett für das Frontend aus.
$csrf_protection_backend = 1;
Dies auf 0 gesetzt, schaltet den Schutz komplett für das Backend aus.
Meine Empfehlung:
$csrf_protection_enable und $csrf_protection_backend sollten in jedem Fall auf 1 gesetzt sein. Falls es Probleme gibt, bitte hier melden. Im Falle von Problemen kann man $csrf_protection_backend temporär auf 0 setzen um benötigte Änderungen durchzuführen. Danach wieder auf 1 setzen.
$csrf_protection_frontend sollte man natürlich am besten auf 1 belassen. Falls es Probleme gibt, kann man hier aber vorrübergehend 0 setzen um die Galerie am Laufen zu halten.
-
Ich habe die csrf_utils.php im Hauptpost aktualisiert. Bitte ersetzt die aktuelle mit dieser, dann sollten auch die Plugins wieder funktionieren.
...
funktioniert tatsächlich :mrgreen: danke!
mfg Andi
-
Meine Empfehlung:
$csrf_protection_frontend sollte man natürlich am besten auf 1 belassen. Falls es Probleme gibt, kann man hier aber vorrübergehend 0 setzen um die Galerie am Laufen zu halten.
Die Suche von außerhalb klappt aber immer noch nicht
würde ungerne drauf verzichten
LG Harald
-
Du musst in dem Suchformular lediglich das method-Attribut auf "get" ändern:
<form target="_blank" action="http://www.online-fremdfigurenkatalog.de/search.php" method="get">
-
perfekt :thumbup:
LG
-
Ja, sorry. Ich hatte Kais Post geändert und vergessen den Link im Text anzupassen. Link stimmt jetzt.
-
Das finde ich sehr interessant :D
Scriptversion: 1.7.9
-
hmm, was sollte sonst nach 1.7.8 kommen :wink:
-
Damit meinte ich, dass es wohl nicht mehr so lange dauern wird.
Mal sehen ob da mal richtig viel verändert wurde :D
-
This is but then is not off topic.
Error message received: "CSRF check failed"
using v1.7.7, with the CSRF security fix obviously installed, on 30 Oct, after the files were updated ...
Action to cause the error message:
performing multiupload of images using V@no's mutliupload form; max setting for file upload is 18000 kb
so I set the number of images to upload at 7, which all told came to about 13 mb. hitting upload caused the error.
I eventually determined that I needed to change the max upload setting in my php.ini file setting but ....
the looming question:
will all error messages now read as " CSRF check failed?"
Thanks,
Brian
was experiencing a similar issue last week before the csrf security fix when I tried to upload any more than three images at a time.
Tried using V@no's multi upload and Budduke's multiupload that he created for the user category.
-
Hi
In file admin/admin_global.php
When added
if ($csrf_protection_enable && $csrf_protection_backend) {
csrf_start();
}
Can not be approval for the images at waiting list
I got page 404 Upon approval
Is there another solution
-
I am using version 1.7 and had to deviate from these instructions in two cases since I couldn't find those lines:
global.php
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');
Instead I did this:
Search for include(ROOT_PATH.'includes/functions.php'); and then insert the above code.
admin/admin_global.php
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();
}
Instead I did this:
Search for include(ROOT_PATH.'admin/admin_functions.php'); and then insert the above code.
I hope this doesn't break anything or stop this fix from working.