diff options
| author | jvoisin | 2018-01-04 15:59:59 +0100 |
|---|---|---|
| committer | GitHub | 2018-01-04 15:59:59 +0100 |
| commit | 3b113be573cdbca20ce9ec9c0a6efb25ccf51db5 (patch) | |
| tree | 5fabbd1da7cd740f26354ffbd2234eba71ffdead /doc | |
| parent | 84e423300c440e96c34ada2620e0f78f827592e8 (diff) | |
Eval blacklist
Add support for eval filtering, only blacklist for now
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/source/config.rst | 14 | ||||
| -rw-r--r-- | doc/source/features.rst | 13 |
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 | ||
| 249 | Eval 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 | ||
| 255 | forbidden 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 | |||
| 249 | Virtual-patching | 263 | Virtual-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 | |||
| 321 | would be to use a different user to run PHP than for administrating the website, | 321 | would be to use a different user to run PHP than for administrating the website, |
| 322 | and using this feature to lock this up. | 322 | and using this feature to lock this up. |
| 323 | 323 | ||
| 324 | .. _eval-feature: | ||
| 325 | |||
| 326 | White and blacklist in ``eval`` | ||
| 327 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 328 | |||
| 329 | While `eval <https://secure.php.net/manual/en/function.eval.php>`__ is a | ||
| 330 | dangerous primitive, tricky to use right, with almost no legitimate usage | ||
| 331 | besides templating and building mathematical expressions based on user input, | ||
| 332 | it's broadly (mis)used all around the web. | ||
| 333 | |||
| 334 | Snuffleupagus provides a white and blacklist mechanism, to explicitly allow | ||
| 335 | and forbid specific functions call from being issued inside ``eval``. | ||
| 336 | |||
| 324 | 337 | ||
| 325 | Protection against cross site request forgery | 338 | Protection against cross site request forgery |
| 326 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 339 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
