diff options
| author | Stefan Esser | 2014-02-16 10:45:17 +0100 |
|---|---|---|
| committer | Stefan Esser | 2014-02-16 10:45:17 +0100 |
| commit | 04f02a230d40c2d86b9d477a7810de24b15a7590 (patch) | |
| tree | 845b75d12015b95ad2a566bb9ef94e4e731543f1 /tests/include/include_uploaded_file_from_FILES.phpt | |
| parent | 2bf085a8d27a5b9a05a0164fcc0c1ea41e78c601 (diff) | |
Add various tests for include filename checks
Diffstat (limited to 'tests/include/include_uploaded_file_from_FILES.phpt')
| -rw-r--r-- | tests/include/include_uploaded_file_from_FILES.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/include/include_uploaded_file_from_FILES.phpt b/tests/include/include_uploaded_file_from_FILES.phpt new file mode 100644 index 0000000..1ec20f3 --- /dev/null +++ b/tests/include/include_uploaded_file_from_FILES.phpt | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing include file from $_FILES | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php include "../skipifcli.inc"; ?> | ||
| 5 | --INI-- | ||
| 6 | suhosin.log.syslog=0 | ||
| 7 | suhosin.log.sapi=0 | ||
| 8 | suhosin.log.stdout=255 | ||
| 9 | suhosin.log.script=0 | ||
| 10 | suhosin.log.phpscript=0 | ||
| 11 | suhosin.executor.include.whitelist= | ||
| 12 | suhosin.executor.include.blacklist= | ||
| 13 | --POST_RAW-- | ||
| 14 | Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 | ||
| 15 | -----------------------------20896060251896012921717172737 | ||
| 16 | Content-Disposition: form-data; name="f1"; filename="filename2" | ||
| 17 | |||
| 18 | <?php echo "NO_GOOD/n"; | ||
| 19 | -----------------------------20896060251896012921717172737-- | ||
| 20 | --FILE-- | ||
| 21 | <?php | ||
| 22 | include $_FILES['f1']['tmp_name']; | ||
| 23 | ?> | ||
| 24 | --EXPECTF-- | ||
| 25 | ALERT - Include filename is an uploaded file (attacker 'REMOTE_ADDR not set', file '%s', line 2) \ No newline at end of file | ||
