diff options
| author | Ben Fuhrmannek | 2021-11-11 13:15:52 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-11-11 13:15:52 +0100 |
| commit | 713cb08b58d4e5dd5e7e80b1f82e27cbe52d4381 (patch) | |
| tree | b1bd945693215ca349180d44ae929f7f59427f09 /src/tests | |
| parent | 9111fdf5e6332923a5faf9f8a7e6b428eb91795a (diff) | |
inverted logic. set xxe_protection.enable() instead of disable_xxe.disable()
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/xxe/config/disable_xxe.ini | 2 | ||||
| -rw-r--r-- | src/tests/xxe/config/disable_xxe_disable.ini | 2 | ||||
| -rw-r--r-- | src/tests/xxe/disable_xxe_dom_disabled.phpt | 4 | ||||
| -rw-r--r-- | src/tests/xxe/disable_xxe_simplexml.phpt | 3 | ||||
| -rw-r--r-- | src/tests/xxe/disable_xxe_simplexml_oop.phpt | 3 | ||||
| -rw-r--r-- | src/tests/xxe/disable_xxe_xml_parse.phpt | 5 |
6 files changed, 12 insertions, 7 deletions
diff --git a/src/tests/xxe/config/disable_xxe.ini b/src/tests/xxe/config/disable_xxe.ini index bc9d1f2..a50a3b9 100644 --- a/src/tests/xxe/config/disable_xxe.ini +++ b/src/tests/xxe/config/disable_xxe.ini | |||
| @@ -1 +1 @@ | |||
| sp.disable_xxe.enable(); | sp.xxe_protection.enable(); | ||
diff --git a/src/tests/xxe/config/disable_xxe_disable.ini b/src/tests/xxe/config/disable_xxe_disable.ini index bb1e432..eaf5755 100644 --- a/src/tests/xxe/config/disable_xxe_disable.ini +++ b/src/tests/xxe/config/disable_xxe_disable.ini | |||
| @@ -1 +1 @@ | |||
| sp.disable_xxe.disable(); | sp.xxe_protection.disable(); | ||
diff --git a/src/tests/xxe/disable_xxe_dom_disabled.phpt b/src/tests/xxe/disable_xxe_dom_disabled.phpt index a49e094..107171c 100644 --- a/src/tests/xxe/disable_xxe_dom_disabled.phpt +++ b/src/tests/xxe/disable_xxe_dom_disabled.phpt | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | --TEST-- | 1 | --TEST-- |
| 2 | Disable XXE | 2 | Disable XXE (feature enabled) |
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php if (!extension_loaded("snuffleupagus") || !extension_loaded("dom")) print("skip"); ?> | 4 | <?php if (!extension_loaded("snuffleupagus") || !extension_loaded("dom")) print("skip"); ?> |
| 5 | <?php if (PHP_VERSION_ID >= 80000) print "skip"; ?> | 5 | <?php if (PHP_VERSION_ID >= 80000) print "skip"; ?> |
| 6 | --INI-- | 6 | --INI-- |
| 7 | sp.configuration_file={PWD}/config/disable_xxe_disable.ini | 7 | sp.configuration_file={PWD}/config/disable_xxe.ini |
| 8 | --EXTENSIONS-- | 8 | --EXTENSIONS-- |
| 9 | dom | 9 | dom |
| 10 | --FILE-- | 10 | --FILE-- |
diff --git a/src/tests/xxe/disable_xxe_simplexml.phpt b/src/tests/xxe/disable_xxe_simplexml.phpt index 1d3ef4c..9560156 100644 --- a/src/tests/xxe/disable_xxe_simplexml.phpt +++ b/src/tests/xxe/disable_xxe_simplexml.phpt | |||
| @@ -2,8 +2,9 @@ | |||
| 2 | Disable XXE | 2 | Disable XXE |
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php if (!extension_loaded("snuffleupagus") || !extension_loaded("simplexml") || getenv('TRAVIS')) print("skip"); ?> | 4 | <?php if (!extension_loaded("snuffleupagus") || !extension_loaded("simplexml") || getenv('TRAVIS')) print("skip"); ?> |
| 5 | <?php if (PHP_VERSION_ID >= 80000) print "skip"; ?> | ||
| 5 | --INI-- | 6 | --INI-- |
| 6 | sp.configuration_file={PWD}/config/disable_xxe.ini | 7 | sp.configuration_file={PWD}/config/disable_xxe_disable.ini |
| 7 | --EXTENSIONS-- | 8 | --EXTENSIONS-- |
| 8 | simplexml | 9 | simplexml |
| 9 | --XFAIL-- | 10 | --XFAIL-- |
diff --git a/src/tests/xxe/disable_xxe_simplexml_oop.phpt b/src/tests/xxe/disable_xxe_simplexml_oop.phpt index e101337..1b2c4ca 100644 --- a/src/tests/xxe/disable_xxe_simplexml_oop.phpt +++ b/src/tests/xxe/disable_xxe_simplexml_oop.phpt | |||
| @@ -2,8 +2,9 @@ | |||
| 2 | Disable XXE | 2 | Disable XXE |
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php if (!extension_loaded("snuffleupagus") || !extension_loaded("simplexml") || getenv('TRAVIS')) print("skip"); ?> | 4 | <?php if (!extension_loaded("snuffleupagus") || !extension_loaded("simplexml") || getenv('TRAVIS')) print("skip"); ?> |
| 5 | <?php if (PHP_VERSION_ID >= 80000) print "skip"; ?> | ||
| 5 | --INI-- | 6 | --INI-- |
| 6 | sp.configuration_file={PWD}/config/disable_xxe.ini | 7 | sp.configuration_file={PWD}/config/disable_xxe_disable.ini |
| 7 | --EXTENSIONS-- | 8 | --EXTENSIONS-- |
| 8 | simplexml | 9 | simplexml |
| 9 | --XFAIL-- | 10 | --XFAIL-- |
diff --git a/src/tests/xxe/disable_xxe_xml_parse.phpt b/src/tests/xxe/disable_xxe_xml_parse.phpt index 6b48bea..bc7e338 100644 --- a/src/tests/xxe/disable_xxe_xml_parse.phpt +++ b/src/tests/xxe/disable_xxe_xml_parse.phpt | |||
| @@ -70,7 +70,8 @@ $parser = create_parser(); | |||
| 70 | $doc = xml_parse($parser, $xml, true); | 70 | $doc = xml_parse($parser, $xml, true); |
| 71 | xml_parser_free($parser); | 71 | xml_parser_free($parser); |
| 72 | 72 | ||
| 73 | --EXPECT-- | 73 | --EXPECTF-- |
| 74 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line 41 | ||
| 74 | string(4) "TEST" | 75 | string(4) "TEST" |
| 75 | 76 | ||
| 76 | array(0) { | 77 | array(0) { |
| @@ -81,6 +82,8 @@ array(0) { | |||
| 81 | } | 82 | } |
| 82 | string(7) "TESTING" | 83 | string(7) "TESTING" |
| 83 | string(4) "TEST" | 84 | string(4) "TEST" |
| 85 | |||
| 86 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line 46 | ||
| 84 | string(4) "TEST" | 87 | string(4) "TEST" |
| 85 | 88 | ||
| 86 | array(0) { | 89 | array(0) { |
