Bug 1003454

Summary: beaker-proxy does not enforce HTTP request size limits
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: lab controllerAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.14CC: aigao, asaha, dcallagh, qwan, rmancy, tools-bugs, xma
Target Milestone: 0.17.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-18 08:17:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2013-09-02 05:17:25 UTC
Description of problem:
If an XML-RPC caller (harness implementation or some other entity) makes a call with very large parameters, beaker-proxy will still receive the entire HTTP request body and attempt to parse the XML and unmarshal the XML-RPC request. This may succeed eventually but will use large amounts of memory (several times the size of the original request).

beaker-proxy should enforce a sane size limit on incoming request bodies to prevent this problem. 50MB should be enough. Log file uploads are supposed to be chunked so that shouldn't be a problem.

Version-Release number of selected component (if applicable):
0.14

Steps to Reproduce:
1. Send a very large XML-RPC call to beaker-proxy, for example:
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://schlenk:8000/RPC2')
>>> s.task_upload_file('123', 'debug', '.task_beah_raw', 4096, '', 1024, ['LCB7fSwgbnVsbCwgeyJ0YXNrX2lkIjogIjNkNjYwYjk5LWRjMjAtNDE5ZC05MDA2LTUyNDIxYTBl'] * (1024*1024*10))

Actual results:
Watch beaker-proxy choke and die.

Expected results:
beaker-proxy refuses the request (including, refusing to read the entire body) with status 413.

Comment 2 Dan Callaghan 2014-06-23 06:39:18 UTC
On Gerrit: http://gerrit.beaker-project.org/3163

Limits request bodies in beaker-proxy to 10MB.

Comment 5 Dan Callaghan 2014-07-18 08:17:43 UTC
Beaker 0.17.1 has been released.