Changes between Initial Version and Version 1 of Ticket #14192


Ignore:
Timestamp:
Aug 29, 2010, 6:45:14 PM (14 years ago)
Author:
Russell Keith-Magee
Comment:

Fixed formatting

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14192 – Description

    initial v1  
    11
    22As per my original email to the django users mailing list:
    3 "
     3
    44Ok so I was looking through the code and I saw this (in
    55django/core/files/uploadhandler.py) :
    66
    7 
     7{{{
    88FileUploadHandler
    99...
     
    1717      content_length (and sometimes won't even get it).
    1818      """
    19 
     19}}}
    2020So the content_length we control right? - Maybe I missed something but
    2121... I can say I want to upload a small file then upload a file that
     
    2323
    2424And then this.
    25 
     25{{{
    2626class MemoryFileUploadHandler(FileUploadHandler):
    2727  """
     
    7272          content_type = self.content_type,
    7373          size = file_size,
     74}}}
    7475
    7576There is a regression test for this  BUT --> in the test suite there
     
    7879(django/tests/regressiontests/file_uploads/uploadhandler.py)
    7980
    80 
     81{{{
    8182def receive_data_chunk(self, raw_data, start):
    8283      self.total_upload += len(raw_data)
     
    8485         raise StopUpload(connection_reset=True)
    8586      return raw_data
     87}}}
    8688
    8789So obviously my proposed attack is to simply say "content length is
     
    9092
    9193And the various follow ups, I propose the following fix:
    92 
    93 
    9494
    9595{{{
     
    119119
    120120
    121 "As I understand it an attacker can abuse gzip user requests, if
     121As I understand it an attacker can abuse gzip user requests, if
    122122mod_deflate is enabled (AND configured to decompress incoming user
    123123requests - this is not the default)  in apache2 with a user gziped
     
    125125
    126126So an attack could do effectively have a file like this:
    127 
     127{{{
    128128f = open("rar", "w")
    129129string = ""
     
    132132f.write(string)
    133133f.close()
    134 
     134}}}
    135135ls -lah 20M 2010-08-29 17:15 rar
    136136
Back to Top