diff options
| author | Stefan Esser | 2014-02-12 21:46:31 +0100 |
|---|---|---|
| committer | Stefan Esser | 2014-02-12 21:46:31 +0100 |
| commit | 286ded52361e1cd31151cf945f4d8c7bb05da1c7 (patch) | |
| tree | 50fbba8762f3969e8193ed3dfa6794dfd0e3e08f /tests | |
| parent | 80abd49293bfb34f71f96214d615b1bfbc148928 (diff) | |
Tests for the suhosin.XXX.disallow_nul feature
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/filter/input_filter_allow_nul.phpt | bin | 0 -> 934 bytes | |||
| -rw-r--r-- | tests/filter/input_filter_cookie_disallow_nul.phpt | 29 | ||||
| -rw-r--r-- | tests/filter/input_filter_get_disallow_nul.phpt | 29 | ||||
| -rw-r--r-- | tests/filter/input_filter_post_disallow_nul.phpt | 29 | ||||
| -rw-r--r-- | tests/filter/input_filter_request_disallow_nul.phpt | 48 |
5 files changed, 135 insertions, 0 deletions
diff --git a/tests/filter/input_filter_allow_nul.phpt b/tests/filter/input_filter_allow_nul.phpt new file mode 100644 index 0000000..015d211 --- /dev/null +++ b/tests/filter/input_filter_allow_nul.phpt | |||
| Binary files differ | |||
diff --git a/tests/filter/input_filter_cookie_disallow_nul.phpt b/tests/filter/input_filter_cookie_disallow_nul.phpt new file mode 100644 index 0000000..dab9241 --- /dev/null +++ b/tests/filter/input_filter_cookie_disallow_nul.phpt | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | --TEST-- | ||
| 2 | suhosin input filter (suhosin.cookie.disallow_nul) | ||
| 3 | --INI-- | ||
| 4 | suhosin.log.syslog=0 | ||
| 5 | suhosin.log.sapi=0 | ||
| 6 | suhosin.log.stdout=255 | ||
| 7 | suhosin.log.script=0 | ||
| 8 | suhosin.request.disallow_nul=0 | ||
| 9 | suhosin.cookie.disallow_nul=1 | ||
| 10 | --SKIPIF-- | ||
| 11 | <?php include('skipif.inc'); ?> | ||
| 12 | --COOKIE-- | ||
| 13 | var1=xx%001;var2=2;var3=xx%003;var4=4; | ||
| 14 | --GET-- | ||
| 15 | --POST-- | ||
| 16 | --FILE-- | ||
| 17 | <?php | ||
| 18 | var_dump($_COOKIE); | ||
| 19 | ?> | ||
| 20 | --EXPECTF-- | ||
| 21 | array(2) { | ||
| 22 | ["var2"]=> | ||
| 23 | string(1) "2" | ||
| 24 | ["var4"]=> | ||
| 25 | string(1) "4" | ||
| 26 | } | ||
| 27 | ALERT - ASCII-NUL chars not allowed within COOKIE variables - dropped variable 'var1' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 28 | ALERT - ASCII-NUL chars not allowed within COOKIE variables - dropped variable 'var3' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 29 | ALERT - dropped 2 request variables - (0 in GET, 0 in POST, 2 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s') | ||
diff --git a/tests/filter/input_filter_get_disallow_nul.phpt b/tests/filter/input_filter_get_disallow_nul.phpt new file mode 100644 index 0000000..b7c2ad4 --- /dev/null +++ b/tests/filter/input_filter_get_disallow_nul.phpt | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | --TEST-- | ||
| 2 | suhosin input filter (suhosin.get.disallow_nul) | ||
| 3 | --INI-- | ||
| 4 | suhosin.log.syslog=0 | ||
| 5 | suhosin.log.sapi=0 | ||
| 6 | suhosin.log.stdout=255 | ||
| 7 | suhosin.log.script=0 | ||
| 8 | suhosin.request.disallow_nul=0 | ||
| 9 | suhosin.get.disallow_nul=1 | ||
| 10 | --SKIPIF-- | ||
| 11 | <?php include('skipif.inc'); ?> | ||
| 12 | --COOKIE-- | ||
| 13 | --GET-- | ||
| 14 | var1=xx%001&var2=2&var3=xx%003&var4=4& | ||
| 15 | --POST-- | ||
| 16 | --FILE-- | ||
| 17 | <?php | ||
| 18 | var_dump($_GET); | ||
| 19 | ?> | ||
| 20 | --EXPECTF-- | ||
| 21 | array(2) { | ||
| 22 | ["var2"]=> | ||
| 23 | string(1) "2" | ||
| 24 | ["var4"]=> | ||
| 25 | string(1) "4" | ||
| 26 | } | ||
| 27 | ALERT - ASCII-NUL chars not allowed within GET variables - dropped variable 'var1' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 28 | ALERT - ASCII-NUL chars not allowed within GET variables - dropped variable 'var3' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 29 | ALERT - dropped 2 request variables - (2 in GET, 0 in POST, 0 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s') | ||
diff --git a/tests/filter/input_filter_post_disallow_nul.phpt b/tests/filter/input_filter_post_disallow_nul.phpt new file mode 100644 index 0000000..60c797e --- /dev/null +++ b/tests/filter/input_filter_post_disallow_nul.phpt | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | --TEST-- | ||
| 2 | suhosin input filter (suhosin.post.disallow_nul) | ||
| 3 | --INI-- | ||
| 4 | suhosin.log.syslog=0 | ||
| 5 | suhosin.log.sapi=0 | ||
| 6 | suhosin.log.stdout=255 | ||
| 7 | suhosin.log.script=0 | ||
| 8 | suhosin.request.disallow_nul=0 | ||
| 9 | suhosin.post.disallow_nul=1 | ||
| 10 | --SKIPIF-- | ||
| 11 | <?php include('skipif.inc'); ?> | ||
| 12 | --COOKIE-- | ||
| 13 | --GET-- | ||
| 14 | --POST-- | ||
| 15 | var1=xx%001&var2=2&var3=xx%003&var4=4& | ||
| 16 | --FILE-- | ||
| 17 | <?php | ||
| 18 | var_dump($_POST); | ||
| 19 | ?> | ||
| 20 | --EXPECTF-- | ||
| 21 | array(2) { | ||
| 22 | ["var2"]=> | ||
| 23 | string(1) "2" | ||
| 24 | ["var4"]=> | ||
| 25 | string(1) "4" | ||
| 26 | } | ||
| 27 | ALERT - ASCII-NUL chars not allowed within POST variables - dropped variable 'var1' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 28 | ALERT - ASCII-NUL chars not allowed within POST variables - dropped variable 'var3' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 29 | ALERT - dropped 2 request variables - (0 in GET, 2 in POST, 0 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s') | ||
diff --git a/tests/filter/input_filter_request_disallow_nul.phpt b/tests/filter/input_filter_request_disallow_nul.phpt new file mode 100644 index 0000000..09903ec --- /dev/null +++ b/tests/filter/input_filter_request_disallow_nul.phpt | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | --TEST-- | ||
| 2 | suhosin input filter (suhosin.request.disallow_nul) | ||
| 3 | --INI-- | ||
| 4 | suhosin.log.syslog=0 | ||
| 5 | suhosin.log.sapi=0 | ||
| 6 | suhosin.log.stdout=255 | ||
| 7 | suhosin.log.script=0 | ||
| 8 | suhosin.request.disallow_nul=1 | ||
| 9 | --SKIPIF-- | ||
| 10 | <?php include('skipif.inc'); ?> | ||
| 11 | --COOKIE-- | ||
| 12 | var1=xx%001;var2=2;var3=xx%003;var4=4; | ||
| 13 | --GET-- | ||
| 14 | var1=xx%001&var2=2&var3=xx%003&var4=4& | ||
| 15 | --POST-- | ||
| 16 | var1=xx%001&var2=2&var3=xx%003&var4=4& | ||
| 17 | --FILE-- | ||
| 18 | <?php | ||
| 19 | var_dump($_GET); | ||
| 20 | var_dump($_POST); | ||
| 21 | var_dump($_COOKIE); | ||
| 22 | ?> | ||
| 23 | --EXPECTF-- | ||
| 24 | array(2) { | ||
| 25 | ["var2"]=> | ||
| 26 | string(1) "2" | ||
| 27 | ["var4"]=> | ||
| 28 | string(1) "4" | ||
| 29 | } | ||
| 30 | array(2) { | ||
| 31 | ["var2"]=> | ||
| 32 | string(1) "2" | ||
| 33 | ["var4"]=> | ||
| 34 | string(1) "4" | ||
| 35 | } | ||
| 36 | array(2) { | ||
| 37 | ["var2"]=> | ||
| 38 | string(1) "2" | ||
| 39 | ["var4"]=> | ||
| 40 | string(1) "4" | ||
| 41 | } | ||
| 42 | ALERT - ASCII-NUL chars not allowed within request variables - dropped variable 'var1' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 43 | ALERT - ASCII-NUL chars not allowed within request variables - dropped variable 'var3' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 44 | ALERT - ASCII-NUL chars not allowed within request variables - dropped variable 'var1' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 45 | ALERT - ASCII-NUL chars not allowed within request variables - dropped variable 'var3' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 46 | ALERT - ASCII-NUL chars not allowed within request variables - dropped variable 'var1' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 47 | ALERT - ASCII-NUL chars not allowed within request variables - dropped variable 'var3' (attacker 'REMOTE_ADDR not set', file '%s') | ||
| 48 | ALERT - dropped 6 request variables - (2 in GET, 2 in POST, 2 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s') | ||
