by logan » Oct 12 09 3:20 pm
HTTP clients, although not required to, are encourage to send a content-length header that specifies the overall size of a file being uploaded. This creates a problem for a proxy server that is trying to control allowed file upload size. Because the content-length header is not required, a client can either neglect to add the content-length header, or can spoof the content-length header with a false value in order to bypass any upload restriction that you enforce.
The main problem though is that WinGate treats HTTP headers as strings in policy. This means there is no greater than or less than operators to make decisions on HTTP headers which would be required to make restrictions such as "users are not allowed content-length headers greater than X bytes" or "users are allowed content-length headers less than X bytes". As a string, only the 'equals', 'contains', 'begins with', 'ends with' or 'is empty' operators are available to be used which won't help in this case.
I envisage that in WinGate 7.x it will be simple to use a script (JAVA or LUA) in policy that gets the string value of an HTTP Header and converts it to an integer in order to perform a decision against the int value. This will make controlling file upload size possible.
In summary:
- In WinGate 6.x, this is not possible.
- In WinGate 7.x this will be possible, however not 100% reliable.
To take a stab at what your next question will probably be :-). WinGate 7.x is still in development and I don't have a release date that I can divulge.