summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorjvoisin2018-01-04 15:59:59 +0100
committerGitHub2018-01-04 15:59:59 +0100
commit3b113be573cdbca20ce9ec9c0a6efb25ccf51db5 (patch)
tree5fabbd1da7cd740f26354ffbd2234eba71ffdead /doc
parent84e423300c440e96c34ada2620e0f78f827592e8 (diff)
Eval blacklist
Add support for eval filtering, only blacklist for now
Diffstat (limited to 'doc')
-rw-r--r--doc/source/config.rst14
-rw-r--r--doc/source/features.rst13
2 files changed, 27 insertions, 0 deletions
diff --git a/doc/source/config.rst b/doc/source/config.rst
index e42cb99..d16474f 100644
--- a/doc/source/config.rst
+++ b/doc/source/config.rst
@@ -246,6 +246,20 @@ disable_xxe
246 sp.disable_xxe.enable(); 246 sp.disable_xxe.enable();
247 247
248 248
249Eval white and blacklist
250^^^^^^^^^^^^^^^^^^^^^^^^
251 * `default: disabled`
252 * :ref:`more <eval-feature>`
253
254``eval_filter`` allows to specify white and blacklist of functions allowed and
255forbidden from being called inside ``eval``. The functions names are comma-separated.
256
257::
258
259 sp.eval_filter.blacklist("system,exec,shell_exec");
260 sp.eval_filter.whitelist("strlen,strcmp").simulation();
261
262
249Virtual-patching 263Virtual-patching
250---------------- 264----------------
251 265
diff --git a/doc/source/features.rst b/doc/source/features.rst
index afe139a..8ecf57d 100644
--- a/doc/source/features.rst
+++ b/doc/source/features.rst
@@ -321,6 +321,19 @@ Snuffleupagus can prevent the execution of this kind of file. A good practice
321would be to use a different user to run PHP than for administrating the website, 321would be to use a different user to run PHP than for administrating the website,
322and using this feature to lock this up. 322and using this feature to lock this up.
323 323
324.. _eval-feature:
325
326White and blacklist in ``eval``
327^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
328
329While `eval <https://secure.php.net/manual/en/function.eval.php>`__ is a
330dangerous primitive, tricky to use right, with almost no legitimate usage
331besides templating and building mathematical expressions based on user input,
332it's broadly (mis)used all around the web.
333
334Snuffleupagus provides a white and blacklist mechanism, to explicitly allow
335and forbid specific functions call from being issued inside ``eval``.
336
324 337
325Protection against cross site request forgery 338Protection against cross site request forgery
326^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 339^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^