Diskussion zu Mögliche XSS-Schwäche
-
- Ehemaliges Teammitglied
- Beiträge: 3005
- Registriert: 13.10.2002 15:15
- Wohnort: Wilhelmshaven
- Kontaktdaten:
Ja klar kann man das testen.
Poste in deinem Forum einfach mal diesen Code Wenn sich ein Java Script Fenster öffnet, ist der Bug noch drin, wenn wie hier bei uns der Code einfach hingeschrieben wird hat der einbau erfolgreich geklappt.
[url=http://www.phpBB.de" onclick="alert('Der Bug ist noch enthalten!!')]text[/url]
Poste in deinem Forum einfach mal diesen Code
Code: Alles auswählen
[url=http://www.phpBB.de" onclick="alert('Der Bug ist noch enthalten!!')]text[/url]
[url=http://www.phpBB.de" onclick="alert('Der Bug ist noch enthalten!!')]text[/url]
-
- Ehemaliges Teammitglied
- Beiträge: 3005
- Registriert: 13.10.2002 15:15
- Wohnort: Wilhelmshaven
- Kontaktdaten:
-
- Ehemaliges Teammitglied
- Beiträge: 3005
- Registriert: 13.10.2002 15:15
- Wohnort: Wilhelmshaven
- Kontaktdaten:
Für alle, die das ganze nochmal auf deutsch haben wollen.
Um den Bug aus eurem phpBB 2.0.6 zu entfernen folgt folgender Anweisung:
Suche in includes/bbcode.php
Und ersetzte mit
Suche weiterhin in der includes/bbcode.php
Und ersetzte mit
Suche ebenfalls in der includes/bbcode.php
Und ersetzte mit
Nun die Datei abspeichern und mit der auf dem Server vorhandenen includes/bbcode.php ersetzten.
Um den Bug aus eurem phpBB 2.0.6 zu entfernen folgt folgender Anweisung:
Suche in includes/bbcode.php
Code: Alles auswählen
$bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\5', $bbcode_tpl['url4']);
Code: Alles auswählen
$bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);
Code: Alles auswählen
// matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://.*?[^ \"\n\r\t<]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.([\w\-]+\.)*?[\w\-]+\.[a-z]{2,4}(:?[0-9]*?/[^ \"\n\r\t<]*)?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url2'];
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
$patterns[] = "#\[url=([\w]+?://.*?[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url3'];
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.([\w\-]+\.)*?[\w\-]+\.[a-z]{2,4}(:?[0-9]*?/[^ \"\n\r\t<]*)?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url4'];
Code: Alles auswählen
// matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url2'];
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
$patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url3'];
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url4'];
Code: Alles auswählen
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://.*?[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\-]+\.[\w\-.\~]+(?:/[^ \"\t\n\r<]*)?)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
Code: Alles auswählen
//matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
!!! Warnung !!!
Ungepatchtes phpBB 2.04 -> Keine Problme mit allen (imho) auf Bugtraq erwähnten url-tag-vulnerabilities!!
Gepatche phpBB 2.04 -> Einige url-tag-vulnerabilities funktionieren!!!
Es kann natürlich sein das ich den Code falsch eingebaut habe oder das er für php BB 2.04 nicht geeignet ist!
Auch auf Bugtraq wurde, im Gegesatz zu phpBB.com ("(which also affects 2.0.4 and 2.0.5)"), nicht (wirklich) behauptet dass es auch auf phpBB 2.04 zutrifft!
Wer hat zu dieser Problematik Erfahrungen?
Ungepatchtes phpBB 2.04 -> Keine Problme mit allen (imho) auf Bugtraq erwähnten url-tag-vulnerabilities!!
Gepatche phpBB 2.04 -> Einige url-tag-vulnerabilities funktionieren!!!
Es kann natürlich sein das ich den Code falsch eingebaut habe oder das er für php BB 2.04 nicht geeignet ist!
Auch auf Bugtraq wurde, im Gegesatz zu phpBB.com ("(which also affects 2.0.4 and 2.0.5)"), nicht (wirklich) behauptet dass es auch auf phpBB 2.04 zutrifft!
Wer hat zu dieser Problematik Erfahrungen?