浏览代码

Using QUERY_STRING without sanitizing it is BAD... Encoding it for URL use
should get rid of XSS issue.

jangliss 21 年之前
父节点
当前提交
09cef59b07
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/read_body.php

+ 5 - 1
src/read_body.php

@@ -735,7 +735,11 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
     global $base_uri;
     global $base_uri;
 
 
     $urlMailbox = urlencode($mailbox);
     $urlMailbox = urlencode($mailbox);
-    sqgetGlobalVar('QUERY_STRING', $query_string, SQ_SERVER);
+    if (sqgetGlobalVar('QUERY_STRING', $query_string, SQ_SERVER)) {                                                                 
+        $query_string = urlencode($query_string);                                                                                   
+    } else {                                                                                                                        
+        $query_string = '';                                                                                                         
+    } 
     $url = $base_uri.'src/view_header.php?'.$query_string;
     $url = $base_uri.'src/view_header.php?'.$query_string;
 
 
     $s  = "<TR>\n" .
     $s  = "<TR>\n" .