Assignment 5
Due Date: 2019-12-05
Available Points: 20
This assignment builds on top of previous assignments and primarily focuses on unsafe methods and server-side execution (CGI).Additional Methods
DELETEPUTPOST
N.B. - Update to the OPTIONS method
Additional Status Codes
201Created (viaPUTorPOST)405Method Not Allowed411Length Required413Request Entity Too Large414Request-URI Too Long
Additional Request Headers
Content-typeContent-Length
Additional Response Headers
- No new response headers
Encodings
Content-Type: multipart/form-dataContent-type: application/x-form-www-urlencoded
Required Environment Variables
SCRIPT_NAMESCRIPT_URISCRIPT_FILENAMEHTTP_REFERERHTTP_USER_AGENTREQUEST_METHODREMOTE_ADDRQUERY_STRINGREMOTE_USERAUTH_TYPESERVER_NAMESERVER_SOFTWARESERVER_PORTSERVER_ADDRSERVER_PROTOCOL
Notes
PUTandDELETEare allowed recursively, as per directives in theWeMustProtectThisHouse!file- Limits:
- URI:
2k - Entity:
2MB
- URI:
- You should check for entities longer than advertised as per the
Content-Lengthheader, but I will not test this - Always issue an HTML description describing the results (success or failure) of
PUTandDELETE(we will not produce202or204) - Invoke the URI as an executable program iff:
POST,GET, orHEADmethod is used- The file is executable and not a directory
- Warning!!! – Ensure your URI is relative to your document root (e.g.,
GET /bin/rm?-rf HTTP/1.1would be very bad) - Update the log format to include the
User-agentandRefererrequest headers:
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" - Add
ALLOW-PUTandALLOW-DELETEcustom directives in theWeMustProtectThisHouse!file:
# Hashed lines are comments and order is not important
#
# Whitelist unsafe methods
ALLOW-PUT
ALLOW-DELETE
#
# Following are two special lines:
authorization-type=Basic
realm="Lane Stadium"
# Always quote realm since it might have spaces
#
# User format => name:md5(password)
mln:d3b07384d113edec49eaa6238ad5ff00
bda:c157a79031e1c40f85931829bc5fc552
jbollen:66e0459d0abbc8cd8bd9a88cd226a9b2
Submission and Evaluation
- Extract sample test files tarball into your web server’s document root
- Place your
Dockerfileat the root of your repository (not inside of a nested folder) - Make your
Dockerfilerun your server on port80by default - Release your implementation with the
a5tag - Submissions will be evaluated using a variation of
cs531a5test suite from our testing service and some manual inspection of responses and source code (if necessary) - Tests will be performed based on the contents and structure of the
a5-testfolder of the sample test files - One point will be awarded for passing test cases of each of the previous assignments (except certain test cases where there are obvious backward compatibility conflicts)