diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2013-03-03 15:14:49 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2013-03-03 15:14:49 +1300 |
commit | 8216801728ea2af82614025ca309a3b5db2ad982 (patch) | |
tree | 07f3612228803594d7266a1e36c2c9c29e5174e6 | |
parent | 7835e0c2c7be0e45262a06b5e2ec2399ae019977 (diff) | |
download | mitmproxy-8216801728ea2af82614025ca309a3b5db2ad982.tar.gz mitmproxy-8216801728ea2af82614025ca309a3b5db2ad982.tar.bz2 mitmproxy-8216801728ea2af82614025ca309a3b5db2ad982.zip |
Three more errors turned up with fuzzing.
These are fixed in netlib, regression tests added here.
-rwxr-xr-x | test/fuzzing/go_proxy | 4 | ||||
-rw-r--r-- | test/test_fuzzing.py | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/test/fuzzing/go_proxy b/test/fuzzing/go_proxy index 1e6bbaef..5960d081 100755 --- a/test/fuzzing/go_proxy +++ b/test/fuzzing/go_proxy @@ -3,7 +3,7 @@ # mitmproxy/mitmdump is running on port 8080 in straight proxy mode. # pathod is running on port 9999 -BASE="/Users/aldo/git/public/pathod/venv/bin/pathoc -eo -I 200,400,502 -p 8080 localhost " -$BASE -n 1000 "get:'http://localhost:9999':ir,@1" +BASE="/Users/aldo/git/public/pathod/venv/bin/pathoc -eo -I 200,400,405,502 -p 8080 localhost " +$BASE -n 10000 "get:'http://localhost:9999':ir,@1" diff --git a/test/test_fuzzing.py b/test/test_fuzzing.py index 4b4253d8..857a2b10 100644 --- a/test/test_fuzzing.py +++ b/test/test_fuzzing.py @@ -1,7 +1,8 @@ import tservers """ - A collection of errors turned up by fuzzing. + A collection of errors turned up by fuzzing. Errors are integrated here + after being fixed to check for regressions. """ class TestFuzzy(tservers.HTTPProxTest): @@ -10,3 +11,17 @@ class TestFuzzy(tservers.HTTPProxTest): p = self.pathoc() assert p.request(req%self.server.port).status_code == 400 + def test_nullbytes(self): + req = r'get:"http://localhost:%s":i19,"\x00"' + p = self.pathoc() + assert p.request(req%self.server.port).status_code == 400 + + def test_invalid_ports(self): + req = 'get:"http://localhost:999999"' + p = self.pathoc() + assert p.request(req).status_code == 400 + + def test_invalid_ipv6_url(self): + req = 'get:"http://localhost:%s":i13,"["' + p = self.pathoc() + assert p.request(req%self.server.port).status_code == 400 |