File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 502502# Connection chunk size (processing large responses in chunks to avoid MemoryError crashes - e.g. large table dump in full UNION/inband injections)
503503MAX_CONNECTION_CHUNK_SIZE = 10 * 1024 * 1024
504504
505+ # Maximum response total page size (trimmed if larger)
506+ MAX_CONNECTION_TOTAL_SIZE = 100 * 1024 * 1024
507+
505508# Mark used for trimming unnecessary content in large chunks
506509LARGE_CHUNK_TRIM_MARKER = "__TRIMMED_CONTENT__"
507510
Original file line number Diff line number Diff line change 5151from lib .core .settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE
5252from lib .core .settings import HTTP_SILENT_TIMEOUT
5353from lib .core .settings import MAX_CONNECTION_CHUNK_SIZE
54+ from lib .core .settings import MAX_CONNECTION_TOTAL_SIZE
5455from lib .core .settings import META_REFRESH_REGEX
5556from lib .core .settings import MIN_TIME_RESPONSES
5657from lib .core .settings import IS_WIN
@@ -139,6 +140,11 @@ def __connReadProxy(conn):
139140 retVal += _
140141 break
141142
143+ if len (retVal ) > MAX_CONNECTION_TOTAL_SIZE :
144+ warnMsg = "too large response detected. Automatically trimming it"
145+ singleTimeWarnMessage (warnMsg )
146+ break
147+
142148 return retVal
143149
144150 @staticmethod
You can’t perform that action at this time.
0 commit comments