summaryrefslogtreecommitdiff
path: root/tests/include
diff options
context:
space:
mode:
authorBen Fuhrmannek2015-02-06 22:38:35 +0100
committerBen Fuhrmannek2015-02-06 22:38:35 +0100
commit3741554097cc73f03a9a6a4fa4d65dc01c120bd8 (patch)
tree93938c3a27b8b9d40818f652c30fccfee3b3180e /tests/include
parent4085730874e1d88bb5b675633a171ae20989e45a (diff)
tests for eval white/blacklist + include white/blacklist
Diffstat (limited to 'tests/include')
-rw-r--r--tests/include/include_blacklist.phpt24
-rw-r--r--tests/include/include_blackwhitelist_empty.phpt24
-rw-r--r--tests/include/include_whitelist.phpt24
3 files changed, 72 insertions, 0 deletions
diff --git a/tests/include/include_blacklist.phpt b/tests/include/include_blacklist.phpt
new file mode 100644
index 0000000..f4c3df0
--- /dev/null
+++ b/tests/include/include_blacklist.phpt
@@ -0,0 +1,24 @@
1--TEST--
2Include blacklist
3--SKIPIF--
4<?php include "../skipifcli.inc"; ?>
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=255
8suhosin.log.script=0
9suhosin.log.phpscript=0
10suhosin.executor.include.whitelist=
11suhosin.executor.include.blacklist=foo,boo
12--FILE--
13<?php
14 $var = "file://" . dirname(__FILE__) . "/../empty.inc";
15 include $var;
16 echo $value,"\n";
17 $var = "foo://test";
18 include $var;
19 $var = "boo://test"; // this point is never reached (famous last words)
20 include $var;
21?>
22--EXPECTF--
23value-from-empty.inc
24ALERT - Include filename ('foo://test') is a URL that is forbidden by the blacklist (attacker 'REMOTE_ADDR not set', file '%s', line 6) \ No newline at end of file
diff --git a/tests/include/include_blackwhitelist_empty.phpt b/tests/include/include_blackwhitelist_empty.phpt
new file mode 100644
index 0000000..33380fd
--- /dev/null
+++ b/tests/include/include_blackwhitelist_empty.phpt
@@ -0,0 +1,24 @@
1--TEST--
2Include URL with empty black-/whitelist
3--SKIPIF--
4<?php include "../skipifcli.inc"; ?>
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=255
8suhosin.log.script=0
9suhosin.log.phpscript=0
10suhosin.executor.include.whitelist=
11suhosin.executor.include.blacklist=
12--FILE--
13<?php
14 $var = dirname(__FILE__) . "/../empty.inc";
15 include $var;
16 echo $value,"\n";
17 $var = "foo://test";
18 include $var;
19 $var = "boo://test"; // this point is never reached (famous last words)
20 include $var;
21?>
22--EXPECTF--
23value-from-empty.inc
24ALERT - Include filename ('foo://test') is a URL that is not allowed (attacker 'REMOTE_ADDR not set', file '%s', line 6) \ No newline at end of file
diff --git a/tests/include/include_whitelist.phpt b/tests/include/include_whitelist.phpt
new file mode 100644
index 0000000..a0c771f
--- /dev/null
+++ b/tests/include/include_whitelist.phpt
@@ -0,0 +1,24 @@
1--TEST--
2Include whitelist
3--SKIPIF--
4<?php include "../skipifcli.inc"; ?>
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=255
8suhosin.log.script=0
9suhosin.log.phpscript=0
10suhosin.executor.include.whitelist=file
11suhosin.executor.include.blacklist=
12--FILE--
13<?php
14 $var = "file://" . dirname(__FILE__) . "/../empty.inc";
15 include $var;
16 echo $value,"\n";
17 $var = "foo://test";
18 include $var;
19 $var = "boo://test"; // this point is never reached (famous last words)
20 include $var;
21?>
22--EXPECTF--
23value-from-empty.inc
24ALERT - Include filename ('foo://test') is a URL that is not allowed (attacker 'REMOTE_ADDR not set', file '%s', line 6) \ No newline at end of file