Read max 6MB from archive to protect against tar/zipbombs

This commit is contained in:
shortcutme 2017-07-12 12:28:03 +02:00
parent e525ea2431
commit 2777c4c537
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -66,7 +66,7 @@ class UiRequestPlugin(object):
return super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs) return super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs)
def streamFile(self, file): def streamFile(self, file):
while 1: for i in range(100): # Read max 6MB
try: try:
block = file.read(60 * 1024) block = file.read(60 * 1024)
if block: if block: