Advanced Electron Forum是用PHP编写的在线论坛系统。 Advanced Electron Forum论坛没有安全地调用带有e修饰符的preg_replace()方式: //Email Links if($globals['bbc_email']){ $text = preg_replace( array("/\[email=(.*?)\](.*?)\[\/email\]/ies", "/\[email\](.*?)\[\/email\]/ies"), array('check_email("$1", "$2")', 'check_email("$1", "$1")'), $text); } 上面的例子使用通配符匹配收集发送给替换参数的匹配,如果用户在[email]标签中使用了复杂的变量句法的话就可以执行任意php代码。
Advanced Electron Forum是用PHP编写的在线论坛系统。 Advanced Electron Forum论坛没有安全地调用带有e修饰符的preg_replace()方式: //Email Links if($globals['bbc_email']){ $text = preg_replace( array("/\[email=(.*?)\](.*?)\[\/email\]/ies", "/\[email\](.*?)\[\/email\]/ies"), array('check_email("$1", "$2")', 'check_email("$1", "$1")'), $text); } 上面的例子使用通配符匹配收集发送给替换参数的匹配,如果用户在[email]标签中使用了复杂的变量句法的话就可以执行任意php代码。