From 7877619f856a04af0519e92780b1d6674a8ff3f7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 15 Jun 2013 23:47:02 +0200 Subject: dotdot: introducing dot file path cleanup RFC3986 details how a path part passed in as part of a URI should be "cleaned" from dot sequences before getting used. The described algorithm is now implemented in lib/dotdot.c with the accompanied test case in test 1395. Bug: http://curl.haxx.se/bug/view.cgi?id=1200 Reported-by: Alex Vinnik --- tests/data/test1231 | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tests/data/test1231 (limited to 'tests/data/test1231') diff --git a/tests/data/test1231 b/tests/data/test1231 new file mode 100644 index 000000000..16533a851 --- /dev/null +++ b/tests/data/test1231 @@ -0,0 +1,61 @@ + + + +HTTP +HTTP GET +dotdot removal + + + +# +# Server-side + + +HTTP/1.1 200 OK +Content-Length: 6 +Connection: close + +-foo- + + + +HTTP/1.1 200 OK +Content-Length: 7 +Connection: close + +-cool- + + + +# +# Client-side + + +http + + +HTTP URL with dotdot removal from path + + +http://%HOSTIP:%HTTPPORT/../../hej/but/who/../1231?stupid=me/../1231#soo/../1231 http://%HOSTIP:%HTTPPORT/../../hej/but/who/../12310001#/../12310001 + + + +# +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /hej/but/1231?stupid=me/../1231 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /hej/but/12310001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + -- cgit v1.2.3