summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/filter/input_filter_cookie_max_value_length.phpt33
-rw-r--r--tests/filter/input_filter_get_max_value_length.phpt33
-rw-r--r--tests/filter/input_filter_post_max_value_length.phpt33
-rw-r--r--tests/filter/input_filter_post_max_value_length_rfc1867.phptbin0 -> 1790 bytes
-rw-r--r--tests/filter/input_filter_request_max_value_length.phpt58
5 files changed, 157 insertions, 0 deletions
diff --git a/tests/filter/input_filter_cookie_max_value_length.phpt b/tests/filter/input_filter_cookie_max_value_length.phpt
new file mode 100644
index 0000000..fb8b3d8
--- /dev/null
+++ b/tests/filter/input_filter_cookie_max_value_length.phpt
@@ -0,0 +1,33 @@
1--TEST--
2suhosin input filter (suhosin.cookie.max_value_length)
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8suhosin.request.max_value_length=0
9suhosin.cookie.max_value_length=3
10--SKIPIF--
11<?php include('skipif.inc'); ?>
12--COOKIE--
13var1=1;var2=22;var3=333;var4=4444;var5=55%00555;var6=666666;
14--GET--
15--POST--
16--FILE--
17<?php
18var_dump($_COOKIE);
19?>
20--EXPECTF--
21array(3) {
22 ["var1"]=>
23 string(1) "1"
24 ["var2"]=>
25 string(2) "22"
26 ["var3"]=>
27 string(3) "333"
28}
29ALERT - configured COOKIE variable value length limit exceeded - dropped variable 'var4' (attacker 'REMOTE_ADDR not set', file '%s')
30ALERT - configured COOKIE variable value length limit exceeded - dropped variable 'var5' (attacker 'REMOTE_ADDR not set', file '%s')
31ALERT - configured COOKIE variable value length limit exceeded - dropped variable 'var6' (attacker 'REMOTE_ADDR not set', file '%s')
32ALERT - dropped 3 request variables - (0 in GET, 0 in POST, 3 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s')
33
diff --git a/tests/filter/input_filter_get_max_value_length.phpt b/tests/filter/input_filter_get_max_value_length.phpt
new file mode 100644
index 0000000..a5eaf5b
--- /dev/null
+++ b/tests/filter/input_filter_get_max_value_length.phpt
@@ -0,0 +1,33 @@
1--TEST--
2suhosin input filter (suhosin.get.max_value_length)
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8suhosin.request.max_value_length=0
9suhosin.get.max_value_length=3
10--SKIPIF--
11<?php include('skipif.inc'); ?>
12--COOKIE--
13--GET--
14var1=1&var2=22&var3=333&var4=4444&var5=55%00555&var6=666666&
15--POST--
16--FILE--
17<?php
18var_dump($_GET);
19?>
20--EXPECTF--
21array(3) {
22 ["var1"]=>
23 string(1) "1"
24 ["var2"]=>
25 string(2) "22"
26 ["var3"]=>
27 string(3) "333"
28}
29ALERT - configured GET variable value length limit exceeded - dropped variable 'var4' (attacker 'REMOTE_ADDR not set', file '%s')
30ALERT - configured GET variable value length limit exceeded - dropped variable 'var5' (attacker 'REMOTE_ADDR not set', file '%s')
31ALERT - configured GET variable value length limit exceeded - dropped variable 'var6' (attacker 'REMOTE_ADDR not set', file '%s')
32ALERT - dropped 3 request variables - (3 in GET, 0 in POST, 0 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s')
33
diff --git a/tests/filter/input_filter_post_max_value_length.phpt b/tests/filter/input_filter_post_max_value_length.phpt
new file mode 100644
index 0000000..b560bde
--- /dev/null
+++ b/tests/filter/input_filter_post_max_value_length.phpt
@@ -0,0 +1,33 @@
1--TEST--
2suhosin input filter (suhosin.post.max_value_length)
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8suhosin.request.max_value_length=0
9suhosin.post.max_value_length=3
10--SKIPIF--
11<?php include('skipif.inc'); ?>
12--COOKIE--
13--GET--
14--POST--
15var1=1&var2=22&var3=333&var4=4444&var5=55%00555&var6=666666&
16--FILE--
17<?php
18var_dump($_POST);
19?>
20--EXPECTF--
21array(3) {
22 ["var1"]=>
23 string(1) "1"
24 ["var2"]=>
25 string(2) "22"
26 ["var3"]=>
27 string(3) "333"
28}
29ALERT - configured POST variable value length limit exceeded - dropped variable 'var4' (attacker 'REMOTE_ADDR not set', file '%s')
30ALERT - configured POST variable value length limit exceeded - dropped variable 'var5' (attacker 'REMOTE_ADDR not set', file '%s')
31ALERT - configured POST variable value length limit exceeded - dropped variable 'var6' (attacker 'REMOTE_ADDR not set', file '%s')
32ALERT - dropped 3 request variables - (0 in GET, 3 in POST, 0 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s')
33
diff --git a/tests/filter/input_filter_post_max_value_length_rfc1867.phpt b/tests/filter/input_filter_post_max_value_length_rfc1867.phpt
new file mode 100644
index 0000000..7552255
--- /dev/null
+++ b/tests/filter/input_filter_post_max_value_length_rfc1867.phpt
Binary files differ
diff --git a/tests/filter/input_filter_request_max_value_length.phpt b/tests/filter/input_filter_request_max_value_length.phpt
new file mode 100644
index 0000000..6906fb0
--- /dev/null
+++ b/tests/filter/input_filter_request_max_value_length.phpt
@@ -0,0 +1,58 @@
1--TEST--
2suhosin input filter (suhosin.request.max_value_length)
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8suhosin.request.max_value_length=3
9--SKIPIF--
10<?php include('skipif.inc'); ?>
11--COOKIE--
12var1=1;var2=22;var3=333;var4=4444;var5=55%00555;var6=666666;
13--GET--
14var1=1&var2=22&var3=333&var4=4444&var5=55%00555&var6=666666&
15--POST--
16var1=1&var2=22&var3=333&var4=4444&var5=55%00555&var6=666666&
17--FILE--
18<?php
19var_dump($_GET);
20var_dump($_POST);
21var_dump($_COOKIE);
22?>
23--EXPECTF--
24array(3) {
25 ["var1"]=>
26 string(1) "1"
27 ["var2"]=>
28 string(2) "22"
29 ["var3"]=>
30 string(3) "333"
31}
32array(3) {
33 ["var1"]=>
34 string(1) "1"
35 ["var2"]=>
36 string(2) "22"
37 ["var3"]=>
38 string(3) "333"
39}
40array(3) {
41 ["var1"]=>
42 string(1) "1"
43 ["var2"]=>
44 string(2) "22"
45 ["var3"]=>
46 string(3) "333"
47}
48ALERT - configured request variable value length limit exceeded - dropped variable 'var4' (attacker 'REMOTE_ADDR not set', file '%s')
49ALERT - configured request variable value length limit exceeded - dropped variable 'var5' (attacker 'REMOTE_ADDR not set', file '%s')
50ALERT - configured request variable value length limit exceeded - dropped variable 'var6' (attacker 'REMOTE_ADDR not set', file '%s')
51ALERT - configured request variable value length limit exceeded - dropped variable 'var4' (attacker 'REMOTE_ADDR not set', file '%s')
52ALERT - configured request variable value length limit exceeded - dropped variable 'var5' (attacker 'REMOTE_ADDR not set', file '%s')
53ALERT - configured request variable value length limit exceeded - dropped variable 'var6' (attacker 'REMOTE_ADDR not set', file '%s')
54ALERT - configured request variable value length limit exceeded - dropped variable 'var4' (attacker 'REMOTE_ADDR not set', file '%s')
55ALERT - configured request variable value length limit exceeded - dropped variable 'var5' (attacker 'REMOTE_ADDR not set', file '%s')
56ALERT - configured request variable value length limit exceeded - dropped variable 'var6' (attacker 'REMOTE_ADDR not set', file '%s')
57ALERT - dropped 9 request variables - (3 in GET, 3 in POST, 3 in COOKIE) (attacker 'REMOTE_ADDR not set', file '%s')
58