What is the maximum possible length of a query string?

前端 未结 3 2033
栀梦
栀梦 2020-11-21 07:34

Is it browser dependent? Also, do different web stacks have different limits on how much data they can get from the request?

3条回答
  •  忘掉有多难
    2020-11-21 07:57

    Although officially there is no limit specified by RFC 2616, many security protocols and recommendations state that maxQueryStrings on a server should be set to a maximum character limit of 1024. While the entire URL, including the querystring, should be set to a max of 2048 characters. This is to prevent the Slow HTTP Request DDOS vulnerability on a web server. This typically shows up as a vulnerability on the Qualys Web Application Scanner and other security scanners.

    Please see the below example code for Windows IIS Servers with Web.config:

    
    
        
            
               
                  
               
            
         
    
    
    

    This would also work on a server level using machine.config.

    Note: Limiting query string and URL length may not completely prevent Slow HTTP Requests DDOS attack but it is one step you can take to prevent it.

提交回复
热议问题