To jest tylko wersja do druku, aby zobaczyć pełną wersję tematu, kliknij TUTAJ
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

English version - Security issues phpBB < 2.0.19 also phpBB by Przemo

Przemo - 31-12-2005, 14:01
Temat postu: Security issues phpBB < 2.0.19 also phpBB by Przemo
Security issue valid for Internet Explorer all versions of phpBB < 2.0.19
Allow to read cookies of all users using Internet Explorer, so allow to log in as this user.

Open file: /includes/bbcode.php
phpBB modified by Przemo < 1.9
Kod:
Find:
$patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
Replace with:
$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";

Find:
$patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
Replace with:
$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";

Version 1.9 or higher
Kod:
Find:
$patterns[] = "#\[url\]([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is";
Replace with:
$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";

Find:
$patterns[] = "#\[url\]((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is";
Replace with:
$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";


Bottom for all version

Find:
Kod:
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\".*?\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
Replace with:
Kod:
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=\\\\&quot;(.*?)\\\\&quot;\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\"\\1\\\"]");

Find:
Kod:
if ( preg_match('#\[quote=\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\"(.*?)\\\"\]#si', $possible_start) )
Replace with:
Kod:
if ( preg_match('#\[quote=\\\&quot;#si', $possible_start, $match) && !preg_match('#\[quote=\\\&quot;(.*?)\\\&quot;\]#si', $possible_start) )

Find:
Kod:
if ($close_pos = strpos($text, '"]', $curr_pos + 9))
Replace with:
Kod:
if ($close_pos = strpos($text, '&quot;]', $curr_pos + 14))

Find:
Kod:
if (strpos(substr($text, $curr_pos + 9, $close_pos - ($curr_pos + 9)), '[quote') === false)
Replace with:
Kod:
if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[quote') === false)

Find:
Kod:
$possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 2);
Replace with:
Kod:
$possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7);


Open file: /includes/functions_post.php
Find: (In 1.9 version it appear two times, replace two times)
Kod:
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;');
Replace with:
Kod:
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;', '&quot;');


Open file: privmsg.php
Find:
Kod:
$html_entities_match = array('#&#', '#<#', '#>#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;');
Replace with:
Kod:
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;', '&quot;');

Mobilemick - 31-12-2005, 15:16
Temat postu: r
Sorry in advance........

Is this code change for the new .19 patch that as been released, or is it to update .18 i was using ?


Have looked in bbcode.php and couldnt find the first line of text .

thanks
Mick

Edel - 31-12-2005, 15:33

Przemo napisał/a:
Open file: /includes/functions_post.php
Find: (In 1.9 version it appear two times, replace two times)
Kod:
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;');
Zamień na:
Kod:
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;', '&quot;');


I see bug.
Kod:
Zamień na:


Translate
Kod:
Replace with:

Mobilemick - 31-12-2005, 15:53
Temat postu: d
sorry my Bad, didnt see

Cytat:
Version 1.9 or higher



all changed now :)

Mick

melbo - 01-01-2006, 07:28

hmmm, made the corrections and now my
Kod:
 [quote]text[/quote]
doesent work

pearman - 01-01-2006, 09:54

hello folks, you also have to do this:
in bbcode.php file find:
Kod:
    $text = preg_replace("/\[quote:$uid=\"(.*?)\"\]/si", $bbcode_tpl['quote_username_open'], $text);

after that add this:
Kod:
    $text = preg_replace("/\[quote:$uid=&quot;(.*?)&quot;\]/si", $bbcode_tpl['quote_username_open'], $text);


do not replace this because old quote's will stop works.
regards.

Engwareion - 03-08-2006, 16:54

pearman napisał/a:
hello folks, you also have to do this:
in bbcode.php file find:
Kod:
    $text = preg_replace("/\[quote:$uid=\"(.*?)\"\]/si", $bbcode_tpl['quote_username_open'], $text);

after that add this:
Kod:
    $text = preg_replace("/\[quote:$uid=&quot;(.*?)&quot;\]/si", $bbcode_tpl['quote_username_open'], $text);


do not replace this because old quote's will stop works.
regards.


i did but. but it didn't work. my [quote] command isn't work now.



Powered by phpBB modified by Przemo © 2003 phpBB Group