summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-02-16 11:16:59 +0100
committerBen Fuhrmannek2021-02-16 11:16:59 +0100
commit5484bcb5eb2714e7438927e2566c86a74d7c51af (patch)
treeb78326d2999397be4c08e06b23209981f82a4ea9 /doc/source
parent7ac1e3866ef4f146c6c93a5ca13b9aebb14e936a (diff)
parentcecfdd808da67be908dbe7144cc8c74dfb3f855e (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/changelog.rst103
-rw-r--r--doc/source/conf.py4
-rw-r--r--doc/source/config.rst6
-rw-r--r--doc/source/download.rst30
-rw-r--r--doc/source/faq.rst12
-rw-r--r--doc/source/features.rst41
-rw-r--r--doc/source/index.rst3
-rw-r--r--doc/source/installation.rst80
-rw-r--r--doc/source/papers.rst41
9 files changed, 259 insertions, 61 deletions
diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst
index 55b5c7e..307c92c 100644
--- a/doc/source/changelog.rst
+++ b/doc/source/changelog.rst
@@ -1,9 +1,64 @@
1Changelog 1Changelog
2========= 2=========
3 3
40.7.0 - `Los Elefantes <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.7.0>`__ 2021/01/02
5----------------------------------------------------------------------------------------------------------
4 6
50.5.0 - `Elephant Flats <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.5.0>`__ 2019/06/12 7New features
6-------------------------------------------------------------------------------------------------------------- 8^^^^^^^^^^^^
9* PHP8 support
10* Stacktraces in dumps
11* The ``>`` operator now skips over functions
12
13Improvements
14^^^^^^^^^^^^
15* Move the CI from travis to gitlab-ci
16* Some code simplifications and constifications
17* PCRE2 is now used when possible
18* The ``generate_rules.php`` script is now more portable
19
20Bug fixes
21^^^^^^^^^
22* The strict mode is now disableable
23
24
250.6.0 - `Elephant in the room <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.6.0>`__ 2020/11/06
26----------------------------------------------------------------------------------------------------------
27
28New features
29^^^^^^^^^^^^
30* Allow empty configurations
31
32Improvements
33^^^^^^^^^^^^
34
35* More constification
36* Snuffleupagus should now be able to get client's ip addresses in more cases
37* Documented compatibility with Heroku
38* Improved logging
39* Added a couple of tests
40
41
420.5.1 - `Order of the Elephant <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.5.1>`__ 2020/06/20
43-----------------------------------------------------------------------------------------------------------
44
45New features
46^^^^^^^^^^^^
47* Add support for syslog
48
49
50Improvements
51^^^^^^^^^^^^
52* Improve OSX support
53* Improve marginally of php8+ compatibility
54* Improve php7.4 compatibility
55* Improve the default ruleset
56* Improve the documentation
57* Improve the gitlab CI
58
59
600.5.0 - `Elephant Flats <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.5.0>`__ 2019/06/12
61----------------------------------------------------------------------------------------------------
7 62
8Improvements 63Improvements
9^^^^^^^^^^^^ 64^^^^^^^^^^^^
@@ -28,8 +83,8 @@ Bug fixes
28 83
29 84
30 85
310.4.1 - `Loxodonta <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.4.1>`__ 2018/12/21 860.4.1 - `Loxodonta <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.4.1>`__ 2018/12/21
32-------------------------------------------------------------------------------------------------------------- 87-----------------------------------------------------------------------------------------------
33 88
34Improvements 89Improvements
35^^^^^^^^^^^^ 90^^^^^^^^^^^^
@@ -49,8 +104,8 @@ Bug fixes
49 104
50 105
51 106
520.4.0 - `Oliphant Chuckerbutty <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.4.0>`__ 2018/08/31 1070.4.0 - `Oliphant Chuckerbutty <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.4.0>`__ 2018/08/31
53-------------------------------------------------------------------------------------------------------------- 108-----------------------------------------------------------------------------------------------------------
54 109
55New features 110New features
56^^^^^^^^^^^^ 111^^^^^^^^^^^^
@@ -88,8 +143,8 @@ Bug fixes
88 143
89 144
90 145
910.3.1 - `Elephant Arch <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.3.1>`__ 2018/08/20 1460.3.1 - `Elephant Arch <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.3.1>`__ 2018/08/20
92------------------------------------------------------------------------------------------------------ 147---------------------------------------------------------------------------------------------------
93 148
94Improvements 149Improvements
95^^^^^^^^^^^^ 150^^^^^^^^^^^^
@@ -111,21 +166,21 @@ Bug fixes
111- Fix the Arch Linux's PKGBUILD 166- Fix the Arch Linux's PKGBUILD
112 167
113 168
1140.3.0 - `Dentalium elephantinum <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.3.0>`__ 2018/07/17 1690.3.0 - `Dentalium elephantinum <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.3.0>`__ 2018/07/17
115--------------------------------------------------------------------------------------------------------------- 170------------------------------------------------------------------------------------------------------------
116 171
117New features 172New features
118^^^^^^^^^^^^ 173^^^^^^^^^^^^
119 174
120- Session cookies can now be `encrypted <https://github.com/nbs-system/snuffleupagus/pull/178>`__ 175- Session cookies can now be `encrypted <https://github.com/jvoisin/snuffleupagus/pull/178>`__
121- Some occurrences of `type juggling <https://github.com/nbs-system/snuffleupagus/pull/186>`__ can now be eradicated 176- Some occurrences of `type juggling <https://github.com/jvoisin/snuffleupagus/pull/186>`__ can now be eradicated
122- It's `now possible <https://github.com/nbs-system/snuffleupagus/pull/187>`__ to hook `echo` and `print` 177- It's `now possible <https://github.com/jvoisin/snuffleupagus/pull/187>`__ to hook `echo` and `print`
123 178
124Improvements 179Improvements
125^^^^^^^^^^^^ 180^^^^^^^^^^^^
126 181
127- The `.filename()` filter is `now matching <https://github.com/nbs-system/snuffleupagus/pull/167>`__ on the file where the function is called instead on the one where it's defined. 182- The `.filename()` filter is `now matching <https://github.com/jvoisin/snuffleupagus/pull/167>`__ on the file where the function is called instead on the one where it's defined.
128- Vastly `optimize <https://github.com/nbs-system/snuffleupagus/issues/166>`__ the way we hook native functions 183- Vastly `optimize <https://github.com/jvoisin/snuffleupagus/issues/166>`__ the way we hook native functions
129- The format of the logs has been streamlined to ease their processing 184- The format of the logs has been streamlined to ease their processing
130 185
131 186
@@ -134,11 +189,11 @@ Bug fixes
134 189
135- Better handling of filters for built-in functions 190- Better handling of filters for built-in functions
136- Fix various possible integer overflows 191- Fix various possible integer overflows
137- Fix an `annoying memory leak <https://github.com/nbs-system/snuffleupagus/issues/192#issuecomment-404538124>`__ impacting mostly `mod_php` 192- Fix an `annoying memory leak <https://github.com/jvoisin/snuffleupagus/issues/192#issuecomment-404538124>`__ impacting mostly `mod_php`
138 193
139 194
1400.2.2 - `Elephant Moraine <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.2.2>`__ 2018/04/12 1950.2.2 - `Elephant Moraine <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.2.2>`__ 2018/04/12
141--------------------------------------------------------------------------------------------------------- 196------------------------------------------------------------------------------------------------------
142 197
143New features 198New features
144^^^^^^^^^^^^ 199^^^^^^^^^^^^
@@ -160,8 +215,8 @@ Bug fixes
160- Fix a crash related to variadic functions 215- Fix a crash related to variadic functions
161 216
162 217
1630.2.1 - `Elephant Point <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.2.1>`__ 2018/02/07 2180.2.1 - `Elephant Point <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.2.1>`__ 2018/02/07
164------------------------------------------------------------------------------------------------------- 219----------------------------------------------------------------------------------------------------
165 220
166Bug fixes 221Bug fixes
167^^^^^^^^^ 222^^^^^^^^^
@@ -177,8 +232,8 @@ Improvements
177- Improve a bit the portability of the code 232- Improve a bit the portability of the code
178- Minor code simplification 233- Minor code simplification
179 234
1800.2.0 - `Elephant Rally <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.2.0>`__ - 2018/01/18 2350.2.0 - `Elephant Rally <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.2.0>`__ - 2018/01/18
181--------------------------------------------------------------------------------------------------------- 236------------------------------------------------------------------------------------------------------
182 237
183New features 238New features
184^^^^^^^^^^^^ 239^^^^^^^^^^^^
@@ -209,7 +264,7 @@ External contributions
209 264
210- Simplification and clean up of our linked-list implementation by `smagnin <https://github.com/smagnin>`__ 265- Simplification and clean up of our linked-list implementation by `smagnin <https://github.com/smagnin>`__
211 266
2120.1.0 - `Mighty Mammoth <https://github.com/nbs-system/snuffleupagus/releases/tag/v0.1.0>`__ - 2017/12/21 2670.1.0 - `Mighty Mammoth <https://github.com/jvoisin/snuffleupagus/releases/tag/v0.1.0>`__ - 2017/12/21
213--------------------------------------------------------------------------------------------------------- 268------------------------------------------------------------------------------------------------------
214 269
215- Initial release 270- Initial release
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 644af6e..a150403 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -47,7 +47,7 @@ master_doc = 'index'
47 47
48# General information about the project. 48# General information about the project.
49project = u'Snuffleupagus' 49project = u'Snuffleupagus'
50copyright = u'%d, NBS System' % datetime.now().year 50copyright = u'2017-2018 NBS System, 2019-%d Julien (jvoisin) Voisin' % datetime.now().year
51author = u'Sebastien Blot & Julien Voisin' 51author = u'Sebastien Blot & Julien Voisin'
52 52
53# The version info for the project you're documenting, acts as replacement for 53# The version info for the project you're documenting, acts as replacement for
@@ -57,7 +57,7 @@ author = u'Sebastien Blot & Julien Voisin'
57# The short X.Y version. 57# The short X.Y version.
58version = u'0.1' 58version = u'0.1'
59# The full version, including alpha/beta/rc tags. 59# The full version, including alpha/beta/rc tags.
60release = u'beta' 60release = u'stable'
61 61
62# The language for content autogenerated by Sphinx. Refer to documentation 62# The language for content autogenerated by Sphinx. Refer to documentation
63# for a list of supported languages. 63# for a list of supported languages.
diff --git a/doc/source/config.rst b/doc/source/config.rst
index 91e085c..258b1ab 100644
--- a/doc/source/config.rst
+++ b/doc/source/config.rst
@@ -327,7 +327,11 @@ The ``function`` filter is able to do various dereferencing:
327- ``function("AwesomeClass::my_method")`` will match the method ``my_method`` in the class ``AwesomeClass`` 327- ``function("AwesomeClass::my_method")`` will match the method ``my_method`` in the class ``AwesomeClass``
328- ``function("AwesomeNamespace\\my_function")`` will match the function ``my_function`` in the namespace ``AwesomeNamespace`` 328- ``function("AwesomeNamespace\\my_function")`` will match the function ``my_function`` in the namespace ``AwesomeNamespace``
329 329
330The ``param`` filter is also able to do some dereferencing: 330It's also able to have calltrace constrains: ``function(func1>func2)`` will
331match only if ``func2`` is called **inside** of ``func1``. Do note that their
332might be other functions called between them.
333
334The ``param`` filter is able to do some dereferencing as well:
331 335
332- ``param($foo[bar])`` will get a match on the value corresponding to the ``bar`` key in the hashtable ``foo``. 336- ``param($foo[bar])`` will get a match on the value corresponding to the ``bar`` key in the hashtable ``foo``.
333 Remember that in PHP, almost every data structure is a hashtable. You can of course nest this like 337 Remember that in PHP, almost every data structure is a hashtable. You can of course nest this like
diff --git a/doc/source/download.rst b/doc/source/download.rst
index fd61099..a41af12 100644
--- a/doc/source/download.rst
+++ b/doc/source/download.rst
@@ -4,14 +4,25 @@ Download
4Arch Linux 4Arch Linux
5---------- 5----------
6 6
7We're providing a `PKGBUILD <https://github.com/jvoisin/snuffleupagus/blob/master/PKGBUILD>`__, 7Thanks to `kpcyrd <https://github.com/kpcyrd>`__, Snuffleupagus is
8so you can build a package yourself. 8`available <https://www.archlinux.org/packages/community/x86_64/php-snuffleupagus/>`__
9in Archlinux' community repository.
10
11We're also providing a `PKGBUILD <https://github.com/jvoisin/snuffleupagus/blob/master/PKGBUILD>`__
12if you want to build the package yourself.
9 13
10Alpine Linux 14Alpine Linux
11------------ 15------------
12 16
13We're providing a `APKBUILD <https://github.com/jvoisin/snuffleupagus/blob/master/APKBUILD>`__, 17We're maintaining the `package in Alpine <https://github.com/alpinelinux/aports/blob/master/testing/php7-snuffleupagus/APKBUILD>`__:
14so you can build a package yourself. 18you can simply ``apk add`` it.
19
20CloudLinux
21----------
22
23Snuffleupagus is packaged there `since 2019 <https://www.cloudlinux.com/cloudlinux-os-blog/entry/alt-php-updated-1-98>`__:
24you can ``yum install alt-php*-snuffleupagus`` it.
25
15 26
16Debian and Ubuntu 27Debian and Ubuntu
17----------------- 28-----------------
@@ -20,17 +31,20 @@ We're currently not providing a Debian/Ubuntu repository,
20but you can grab the latest release on `github <https://github.com/jvoisin/snuffleupagus/releases>`__, 31but you can grab the latest release on `github <https://github.com/jvoisin/snuffleupagus/releases>`__,
21or build your own package by cloning the source code and typing ``make debian``. 32or build your own package by cloning the source code and typing ``make debian``.
22 33
34There is a `bug open <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894821>`__
35Debian-side to track the inclusion.
36
23Fedora 37Fedora
24------ 38------
25 39
26Thanks to [Rémo Collet](https://twitter.com/RemiCollet), Snuffleupagus is 40Thanks to `Rémo Collet <https://twitter.com/RemiCollet>`__, Snuffleupagus is
27[packaged](https://pkgs.org/download/php-snuffleupagus) in Fedora! 41`packaged <https://pkgs.org/download/php-snuffleupagus>`__ in Fedora!
28 42
29FreeBSD 43FreeBSD
30------- 44-------
31 45
32Thanks to [Franco Fichtner](https://twitter.com/fitchitis), Snuffleupagus is 46Thanks to `Franco Fichtner <https://twitter.com/fitchitis>`__, Snuffleupagus is
33[packaged](https://www.freshports.org/security/snuffleupagus/) in FreeBSD! 47`packaged <https://www.freshports.org/security/snuffleupagus/>`__ in FreeBSD!
34 48
35Source code 49Source code
36----------- 50-----------
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index 3c09409..bdfc7c1 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -39,14 +39,14 @@ we thought that using an elephant as a mascot would be a great idea.
39Who are you and why did you write Snuffleupagus? 39Who are you and why did you write Snuffleupagus?
40"""""""""""""""""""""""""""""""""""""""""""""""" 40""""""""""""""""""""""""""""""""""""""""""""""""
41 41
42We're working for `NBS System <https://nbs-system.com/en/>`__, 42The project started at `NBS System <https://nbs-system.com/en/>`__,
43a web hosting company (meaning that we're dealing with PHP code all day long), 43a web hosting company (meaning that we're dealing with PHP code all day long),
44with a strong focus on security. We do have several layers of hardening 44with a strong focus on security. We do have several layers of hardening
45(`kernel <https://grsecurity.net/>`_, `WAF <https://naxsi.org>`_, 45(`kernel <https://grsecurity.net/>`_, `WAF <https://naxsi.org>`_,
46`IDS <https://en.wikipedia.org/wiki/Intrusion_detection_system>`_, etc), 46`IDS <https://en.wikipedia.org/wiki/Intrusion_detection_system>`_, etc),
47but we had nothing for PHP7. 47but we had nothing for PHP7.
48 48
49Nowadays, Snuffleupagus is maintained by Julien (jvoisin) Voisin. 49Nowadays, Snuffleupagus is maintained by Julien (`jvoisin <https://dustri.org>`__) Voisin.
50 50
51 51
52Why not Suhosin? 52Why not Suhosin?
@@ -107,8 +107,8 @@ How mature is this project?
107""""""""""""""""""""""""""" 107"""""""""""""""""""""""""""
108 108
109This project has been floating around since early 2016 and we did the first commit 109This project has been floating around since early 2016 and we did the first commit
110the 28ᵗʰ of December of the same year. We're currently in an beta phase, 110the 28ᵗʰ of December of the same year. It's currently stable,
111finding and fixing as many bugs as possible before declaring it stable. 111and is usable and used in production.
112 112
113Are you saying that PHP isn't secure? 113Are you saying that PHP isn't secure?
114""""""""""""""""""""""""""""""""""""" 114"""""""""""""""""""""""""""""""""""""
@@ -187,8 +187,8 @@ Will Snuffleupagus run on my old PHP 5?
187""""""""""""""""""""""""""""""""""""""" 187"""""""""""""""""""""""""""""""""""""""
188No. 188No.
189 189
190Since PHP5 `will be deprecated at the end of 2018 <http://php.net/supported-versions.php>`_, 190Since PHP5 `is deprecated since the end of 2018 <http://php.net/supported-versions.php>`_,
191you should think about moving to PHP7 anyway. You can (and should) use 191you should think about moving to PHP7. You can (and should) use
192`Suhosin <https://suhosin.org>`_ in the meantime. 192`Suhosin <https://suhosin.org>`_ in the meantime.
193 193
194Help and support 194Help and support
diff --git a/doc/source/features.rst b/doc/source/features.rst
index 0c23dc1..2eebc88 100644
--- a/doc/source/features.rst
+++ b/doc/source/features.rst
@@ -30,10 +30,13 @@ This feature is even more effective when used along with :ref:`readonly_exec <re
30Examples of related vulnerabilities 30Examples of related vulnerabilities
31""""""""""""""""""""""""""""""""""" 31"""""""""""""""""""""""""""""""""""
32 32
33- `CVE-2017-7981 <https://tuleap.net/plugins/tracker/?aid=10159>`_: Authenticated remote code execution on Tuleap 33- `CVE-2013-3630 <https://www.rapid7.com/db/modules/exploit/multi/http/moodle_cmd_exec>`__: Authenticated remote code execution in Moodle
34- `CVE-2014-4688 <https://www.pfsense.org/security/advisories/pfSense-SA-14_10.webgui.asc>`_: Authenticated remote code execution on pfSense 34- `CVE-2014-1610 <https://www.rapid7.com/db/modules/exploit/multi/http/mediawiki_thumb>`__: Unauthenticated remote code execution in DokuWiki
35- `CVE-2014-1610 <https://www.rapid7.com/db/modules/exploit/multi/http/mediawiki_thumb>`_: Unauthenticated remote code execution on DokuWiki 35- `CVE-2014-4688 <https://www.pfsense.org/security/advisories/pfSense-SA-14_10.webgui.asc>`__: Authenticated remote code execution in pfSense
36- `CVE-2013-3630 <https://www.rapid7.com/db/modules/exploit/multi/http/moodle_cmd_exec>`_: Authenticated remote code execution on Moodle 36- `CVE-2017-7981 <https://tuleap.net/plugins/tracker/?aid=10159>`__: Authenticated remote code execution in Tuleap
37- `CVE-2018-20434 <https://www.exploit-db.com/exploits/47044>`__: Authenticated remote code execution in LibreNMS
38- `CVE-2020-5791 <https://www.tenable.com/security/research/tra-2020-58)>`__: Authenticated remote code execution in Nagios XI
39- `CVE-2020-8813 <https://www.exploit-db.com/exploits/48159>`__: Unauthenticated remote code execution in Cacti
37- Every single `modem/router/switch/IoT/… <https://twitter.com/internetofshit>`_. 40- Every single `modem/router/switch/IoT/… <https://twitter.com/internetofshit>`_.
38 41
39 42
@@ -62,6 +65,7 @@ Examples of related vulnerabilities
62- `CVE-2016-10074 <https://legalhackers.com/advisories/SwiftMailer-Exploit-Remote-Code-Exec-CVE-2016-10074-Vuln.html>`_: remote code execution in SwiftMailer 65- `CVE-2016-10074 <https://legalhackers.com/advisories/SwiftMailer-Exploit-Remote-Code-Exec-CVE-2016-10074-Vuln.html>`_: remote code execution in SwiftMailer
63- `CVE-2016-10033 <https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html>`_: remote code execution in PHPMailer 66- `CVE-2016-10033 <https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html>`_: remote code execution in PHPMailer
64- `CVE-2016-9920 <https://www.ripstech.com/blog/2016/roundcube-command-execution-via-email/>`_: Unauthenticated remote code execution in Roundcube 67- `CVE-2016-9920 <https://www.ripstech.com/blog/2016/roundcube-command-execution-via-email/>`_: Unauthenticated remote code execution in Roundcube
68- `CVE-2019-???? <https://www.exploit-db.com/exploits/46136>`__: Unauthenticated remote code execution in Horde
65 69
66.. _cookie-encryption-feature: 70.. _cookie-encryption-feature:
67 71
@@ -115,6 +119,9 @@ Examples of related vulnerabilities
115- `CVE-2017-6090 <https://sysdream.com/news/lab/2017-09-29-cve-2017-6090-phpcollab-2-5-1-arbitrary-file-upload-unauthenticated/>`_: Unauthenticated remote code execution in PhpCollab 119- `CVE-2017-6090 <https://sysdream.com/news/lab/2017-09-29-cve-2017-6090-phpcollab-2-5-1-arbitrary-file-upload-unauthenticated/>`_: Unauthenticated remote code execution in PhpCollab
116- `EDB-38407 <https://www.exploit-db.com/exploits/38407/>`_: Authenticated remote code execution in GLPI 120- `EDB-38407 <https://www.exploit-db.com/exploits/38407/>`_: Authenticated remote code execution in GLPI
117- `CVE-2013-5576 <https://developer.joomla.org/security/news/563-20130801-core-unauthorised-uploads>`_: Authenticated remote code execution in Joomla 121- `CVE-2013-5576 <https://developer.joomla.org/security/news/563-20130801-core-unauthorised-uploads>`_: Authenticated remote code execution in Joomla
122- `CVE-2019-15813 <https://www.exploit-db.com/exploits/48955>`__: Authenticated remote code execution in Sentrifugo
123- `CVE-2019-17132 <http://karmainsecurity.com/KIS-2019-02>`__: Authenticated remote code execution in vBulletin
124- `CVE-2020-10682 <http://dev.cmsmadesimple.org/bug/view/12275>`__: Authenticated remote code execution in CMS Made Simple
118- `EDB-19154 <https://www.rapid7.com/db/modules/exploit/multi/http/qdpm_upload_exec>`_: Authenticated remote code execution in qdPM 125- `EDB-19154 <https://www.rapid7.com/db/modules/exploit/multi/http/qdpm_upload_exec>`_: Authenticated remote code execution in qdPM
119 126
120 127
@@ -154,21 +161,26 @@ without the need to invalidate any data.
154 161
155A nice side-effect of this feature is that it will defeat various memory corruption 162A nice side-effect of this feature is that it will defeat various memory corruption
156issues related to the complexity of ``unserialize``'s implementation, 163issues related to the complexity of ``unserialize``'s implementation,
157and the amount of control if provides to an attacker, like `CVE-2016-9137, CVE-2016-9138 <https://bugs.php.net/bug.php?id=73147>`_, 164and the amount of control if provides to an attacker, like `CVE-2016-9137,
158`2016-7124 <https://bugs.php.net/bug.php?id=72663>`_, `CVE-2016-5771 and CVE-2016-5773 <https://www.evonide.com/how-we-broke-php-hacked-pornhub-and-earned-20000-dollar/>`_. 165CVE-2016-9138 <https://bugs.php.net/bug.php?id=73147>`_, `2016-7124
166<https://bugs.php.net/bug.php?id=72663>`_, `CVE-2016-5771 and CVE-2016-5773
167<https://www.evonide.com/how-we-broke-php-hacked-pornhub-and-earned-20000-dollar/>`_.
159 168
160 169
161Examples of related vulnerabilities 170Examples of related vulnerabilities
162""""""""""""""""""""""""""""""""""" 171"""""""""""""""""""""""""""""""""""
163 172
164- `CVE-2016-???? <https://www.computest.nl/advisories/CT-2016-1110_Observium.txt>`_: Unauthenticated remote code execution in Observium (leading to remote root) 173- `CVE-2012-5692 <https://www.rapid7.com/db/modules/exploit/unix/webapp/invision_pboard_unserialize_exec>`_: Unauthenticated remote code execution in IP.Board
165- `CVE-2016-5726 <http://seclists.org/oss-sec/2016/q2/521>`_: Unauthenticated remote code execution in Simple Machines Forums 174- `CVE-2014-1691 <http://seclists.org/oss-sec/2014/q1/153>`_: Unauthenticated remote code execution in Horde
175- `CVE-2015-7808 <https://www.rapid7.com/db/modules/exploit/multi/http/vbulletin_unserialize>`_: Unauthenticated remote code execution in vBulletin
176- `CVE-2015-8562 <https://www.rapid7.com/db/modules/exploit/multi/http/joomla_http_header_rce>`_: Unauthenticated remote code execution in Joomla
166- `CVE-2016-4010 <http://netanelrub.in/2016/05/17/magento-unauthenticated-remote-code-execution/>`_: Unauthenticated remote code execution in Magento 177- `CVE-2016-4010 <http://netanelrub.in/2016/05/17/magento-unauthenticated-remote-code-execution/>`_: Unauthenticated remote code execution in Magento
178- `CVE-2016-5726 <http://seclists.org/oss-sec/2016/q2/521>`_: Unauthenticated remote code execution in Simple Machines Forums
179- `CVE-2016-???? <https://www.computest.nl/advisories/CT-2016-1110_Observium.txt>`_: Unauthenticated remote code execution in Observium (leading to remote root)
167- `CVE-2017-2641 <http://netanelrub.in/2017/03/20/moodle-remote-code-execution/>`_: Unauthenticated remote code execution in Moodle 180- `CVE-2017-2641 <http://netanelrub.in/2017/03/20/moodle-remote-code-execution/>`_: Unauthenticated remote code execution in Moodle
168- `CVE-2015-8562 <https://www.rapid7.com/db/modules/exploit/multi/http/joomla_http_header_rce>`_: Unauthenticated remote code execution in Joomla 181- `CVE-2018-17057 <https://www.exploit-db.com/exploits/46634>`: Unauthenticated remote code execution in LimeSurvey
169- `CVE-2015-7808 <https://www.rapid7.com/db/modules/exploit/multi/http/vbulletin_unserialize>`_: Unauthenticated remote code execution in vBulletin 182- `CVE-2018-19274 <https://blog.ripstech.com/2018/phpbb3-phar-deserialization-to-remote-code-execution/>`__: Authenticated remote code execution in phpBB
170- `CVE-2014-1691 <http://seclists.org/oss-sec/2014/q1/153>`_: Unauthenticated remote code execution in Horde 183- `CVE-2019-6340 <https://www.ambionics.io/blog/drupal8-rce>`__: Unauthenticated remote code execution in Drupal
171- `CVE-2012-5692 <https://www.rapid7.com/db/modules/exploit/unix/webapp/invision_pboard_unserialize_exec>`_: Unauthenticated remote code execution in IP.Board
172 184
173 185
174.. _harden-rand-feature: 186.. _harden-rand-feature:
@@ -317,6 +329,8 @@ and various other types mismatch.
317This feature is largely inspired from the 329This feature is largely inspired from the
318`autostrict <https://github.com/krakjoe/autostrict>`_ module from `krakjoe <http://krakjoe.ninja>`__. 330`autostrict <https://github.com/krakjoe/autostrict>`_ module from `krakjoe <http://krakjoe.ninja>`__.
319 331
332PHP8 already has [this feature](https://wiki.php.net/rfc/consistent_type_errors) for internal functions.
333
320 334
321.. _sloppy-comparisons-feature: 335.. _sloppy-comparisons-feature:
322 336
@@ -339,6 +353,9 @@ but also the `in_array
339<https://secure.php.net/manual/en/function.array-search.php>`__ and `array_keys 353<https://secure.php.net/manual/en/function.array-search.php>`__ and `array_keys
340<https://secure.php.net/manual/en/function.array-keys.php>`__ functions. 354<https://secure.php.net/manual/en/function.array-keys.php>`__ functions.
341 355
356PHP8 is implementing [a subset](https://wiki.php.net/rfc/consistent_type_errors) of this feature.
357
358
342.. _readonly-exec-feature: 359.. _readonly-exec-feature:
343 360
344Preventing execution of writable PHP files 361Preventing execution of writable PHP files
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 955cebb..443abf6 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1,7 +1,8 @@
1Snuffleupagus 1Snuffleupagus
2============= 2=============
3 3
4Snuffleupagus is a `PHP7+ <http://php.net/manual/en/migration70.php>`_ 4Snuffleupagus is a `PHP7+ <https://php.net/manual/en/migration70.php>`__ and
5`PHP8+ <https://www.php.net/manual/en/migration80.php>`__
5module designed to drastically raise the cost of attacks against websites. This is achieved 6module designed to drastically raise the cost of attacks against websites. This is achieved
6by killing entire bug classes and providing a powerful virtual-patching system, 7by killing entire bug classes and providing a powerful virtual-patching system,
7allowing the administrator to fix specific vulnerabilities without having to touch the PHP code. 8allowing the administrator to fix specific vulnerabilities without having to touch the PHP code.
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
index a6b0ff8..c4cc355 100644
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -73,7 +73,85 @@ solvable via:
73 make 73 make
74 74
75 75
76Heroku installation
77-------------------
78
79Heroku's official `buildpack <https://github.com/heroku/heroku-buildpack-php/>`_
80uses ``Composer`` to install all dependencies required by your PHP application.
81Careful with the `default set of rules
82<https://github.com/jvoisin/snuffleupagus/blob/master/config/default.rules>`__,
83since it might block the composer deployment, leading to the following errors:
84
85::
86
87 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2 -F fpm_custom.conf public/`
88 heroku[web.1]: Stopping all processes with SIGTERM
89 app[web.1]: Stopping httpd...
90 app[web.1]: SIGTERM received, attempting graceful shutdown...
91 app[web.1]: Stopping php-fpm...
92 app[web.1]: Shutdown complete.
93 heroku[web.1]: Process exited with status 143
94 app[web.1]: [heroku-exec] Starting
95 app[web.1]: Unable to determine Composer vendor-dir setting; is 'composer' executable on path or 'composer.phar' in current working directory?
96 heroku[web.1]: Process exited with status 1
97 heroku[web.1]: State changed from starting to crashed
98
99Requirements
100^^^^^^^^^^^^
101
102To install snuffleupagus on heroku, simply follow the `documentation <https://devcenter.heroku.com/articles/php-support#custom-compile-step>`_,
103and edit the ``composer.json`` file, as well as the ``Procfile`` to load the additional PHP-FPM configuration.
104
105composer.json
106"""""""""""""
107
108::
109
110 {
111 "require": {
112 "php": "~7.4.6"
113 },
114 "config": {
115 "platform": {
116 "php": "7.4.6"
117 }
118 },
119 "scripts": {
120 "compile": [
121 "git clone https://github.com/jvoisin/snuffleupagus /tmp/snuffleupagus",
122 "cd /tmp/snuffleupagus/src && phpize && ./configure --enable-snuffleupagus && make && make install",
123 "echo 'extension=snuffleupagus.so\nsp.allow_broken_configuration=on\nsp.configuration_file=/dev/null' > /app/.heroku/php/etc/php/conf.d/999-ext-snuffleupagus.ini"
124 ]
125 }
126 }
127
128This configuration will compile Snuffleupagus to shared library, install it to the proper
129location and specify an empty configuration in ``sp.configuration_file`` to ensure
130that the ``composer`` deployment phase won't get killed by some rules.
131
132PHP-FPM
133"""""""
134
135::
136
137 ; ext-snuffleupagus
138 php_admin_flag[sp.allow_broken_configuration] = off
139 php_admin_value[sp.configuration_file] = /app/default.rules
140
141The final step is to point ``sp.configuration_file`` to a rule set by setting
142the preference in an additional `PHP-FPM
143configuration <https://devcenter.heroku.com/articles/custom-php-settings#php-fpm-configuration-include>`_.
144
145You should now be running Snuffleupagus in PHP on heroku:
146
147::
148
149 app[web.1]: [05-Jul-2020 07:45:22 UTC] PHP Fatal error: [snuffleupagus][0.0.0.0][disabled_function] Aborted execution on call of the function 'exec', because its argument '$command' content (id;whoami) matched a rule in /app/public/test2.php on line 1
150 app[web.1]: 10.9.226.141 - - [05/Jul/2020:07:45:22 +0000] "GET /test2.php?cmd=id;whoami HTTP/1.1" 500 - "-" "curl/7.68.0
151 heroku[router]: at=info method=GET path="/test2.php?cmd=id;whoami" host=heroku-x-snuffleupagus.herokuapp.com request_id=012345678-9012-3456-7890-123456789012 fwd="1.2.3.4" dyno=web.1 connect=0ms service=7ms status=500 bytes=169 protocol=http
152
153
76Upgrading 154Upgrading
77--------- 155---------
78 156
79Upgrading the Snuffleupagus is as simple as recompiling it (or using a binary), replacing the file and restarting your webserver. 157Upgrading Snuffleupagus is as simple as recompiling it (or using a binary), replacing the file and restarting your webserver.
diff --git a/doc/source/papers.rst b/doc/source/papers.rst
index 3d5e42a..3cdb909 100644
--- a/doc/source/papers.rst
+++ b/doc/source/papers.rst
@@ -9,15 +9,15 @@ Talks
92017 92017
10"""" 10""""
11 11
12- `BerlinSide0x08 <https://berlinsides.org/?page_id=2168>`_ - `slides <https://github.com/nbs-system/snuffleupagus/blob/master/slides/berlinsides_2017.pdf>`__ 12- `BerlinSide0x08 <https://berlinsides.org/?page_id=2168>`_ - `slides <https://github.com/jvoisin/snuffleupagus/blob/master/slides/berlinsides_2017.pdf>`__
13- `Hack.lu 2017 <https://2017.hack.lu/talks/>`_ - `slides <https://github.com/nbs-system/snuffleupagus/blob/master/slides/hacklu_2017.pdf>`__ - `video <https://www.youtube.com/watch?v=RzaRiuJ6MkI>`__ 13- `Hack.lu 2017 <https://2017.hack.lu/talks/>`_ - `slides <https://github.com/jvoisin/snuffleupagus/blob/master/slides/hacklu_2017.pdf>`__ - `video <https://www.youtube.com/watch?v=RzaRiuJ6MkI>`__
14- `BlackAlps <https://blackalps.ch/2017program.php>`_ - `slides <https://github.com/nbs-system/snuffleupagus/blob/master/slides/blackalps_2017.pdf>`__ - `video <https://www.youtube.com/watch?v=2GeUnOzDGxc>`__ 14- `BlackAlps <https://blackalps.ch/2017program.php>`_ - `slides <https://github.com/jvoisin/snuffleupagus/blob/master/slides/blackalps_2017.pdf>`__ - `video <https://www.youtube.com/watch?v=2GeUnOzDGxc>`__
15 15
162018 162018
17"""" 17""""
18 18
19- `Pass the Salt <https://2018.pass-the-salt.org/schedule/#snuffleupagus>`_ - `slides <https://github.com/nbs-system/snuffleupagus/blob/master/slides/passthesalt_2018.pdf>`__ - `video <https://passthesalt.ubicast.tv/videos/snuffleupagus-killing-bug-classes-and-virtual-patching-the-rest/>`__ 19- `Pass the Salt <https://2018.pass-the-salt.org/schedule/#snuffleupagus>`_ - `slides <https://github.com/jvoisin/snuffleupagus/blob/master/slides/passthesalt_2018.pdf>`__ - `video <https://passthesalt.ubicast.tv/videos/snuffleupagus-killing-bug-classes-and-virtual-patching-the-rest/>`__
20- `44con <https://44con.com/44con/44con-2018/44con-2018-talks/>`__ - `slides <https://github.com/nbs-system/snuffleupagus/blob/master/slides/44con_2018.pdf>`__ 20- `44con <https://44con.com/44con/44con-2018/44con-2018-talks/>`__ - `slides <https://github.com/jvoisin/snuffleupagus/blob/master/slides/44con_2018.pdf>`__
21 21
222020 222020
23"""" 23""""
@@ -31,13 +31,17 @@ Mentions
31 31
32- `Habr - PHP-Дайджест № 118 – свежие новости, материалы и инструменты <https://habr.com/en/company/zfort/blog/339630/>`__ (ru) - Habr 32- `Habr - PHP-Дайджест № 118 – свежие новости, материалы и инструменты <https://habr.com/en/company/zfort/blog/339630/>`__ (ru) - Habr
33- `Intrinsec's blog - Hack.lu 2017 <https://securite.intrinsec.com/2017/10/20/hack-lu-2017/>`__ (fr) - Intrinsec's blog 33- `Intrinsec's blog - Hack.lu 2017 <https://securite.intrinsec.com/2017/10/20/hack-lu-2017/>`__ (fr) - Intrinsec's blog
34- `Paragon Initiative Enterprises Blog - The 2018 Guide to Building Secure PHP Software <https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software>`__ - 2017-12-12 34- `Paragon Initiative Enterprises Blog - The 2018 Guide to Building Secure PHP Software <https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software>`__
35 35
362018 362018
37"""" 37""""
38 38
39- `Habr - PHP-Дайджест № 138 <https://habr.com/en/company/zfort/blog/422069/>`__ (ru) - Habr 39- `Habr - PHP-Дайджест № 138 <https://habr.com/en/company/zfort/blog/422069/>`__ (ru) - Habr
40- `PhpStorm's blog - PHP Annotated Monthly <https://blog.jetbrains.com/phpstorm/2018/08/php-annotated-monthly-august-2018/>`__ - PhpStorm's blog 40- `PhpStorm's blog - PHP Annotated Monthly <https://blog.jetbrains.com/phpstorm/2018/08/php-annotated-monthly-august-2018/>`__ - PhpStorm's blog
41- `PHP Weekly <http://www.phpweekly.com/archive/2018-02-08.html>`__
42- `New variant in wp-gdpr-compliance vulnerability and fixing it with virtual
43 patching <https://medium.com/alertot/new-variant-in-wp-gdpr-compliance-vulnerability-and-fixing-it-with-virtual-patching-4b72d7496c1c>`__
44 - alertot
41 45
422019 462019
43"""" 47""""
@@ -46,6 +50,17 @@ Mentions
46- `Habr - PHP-Дайджест № 160 <https://habr.com/ru/post/460022/>`__ (ru) - Habr 50- `Habr - PHP-Дайджест № 160 <https://habr.com/ru/post/460022/>`__ (ru) - Habr
47 51
48 52
532020
54""""
55
56- `Modern PHP Security Part 2: Breaching and hardening the PHP engine <https://labs.detectify.com/2020/08/20/modern-php-security-part-2-breaching-and-hardening-the-php-engine/>`__ - Detectify's blog
57
582021
59""""
60
61- `Habr - PHP Дайджест № 196 <https://habr.com/ru/post/536726/>`__ (ru) - Habr
62
63
49Articles 64Articles
50-------- 65--------
51 66
@@ -72,6 +87,20 @@ Articles
72- `Проект Snuffleupagus развивает PHP-модуль для блокирования уязвимостей <https://www.opennet.ru/opennews/art.shtml?num=51031>`__ (ru) - opennet.ru 87- `Проект Snuffleupagus развивает PHP-модуль для блокирования уязвимостей <https://www.opennet.ru/opennews/art.shtml?num=51031>`__ (ru) - opennet.ru
73- `What the f*ck is a Snuffleupagus? <https://medium.com/@live_the_dream/what-the-f-ck-is-a-snuffleupagus-f838fb64f857>`__ - Living The Dream 88- `What the f*ck is a Snuffleupagus? <https://medium.com/@live_the_dream/what-the-f-ck-is-a-snuffleupagus-f838fb64f857>`__ - Living The Dream
74- `Snuffleupagus: Open source security tool hardens PHP sites against cyber-attacks <https://portswigger.net/daily-swig/snuffleupagus-open-source-security-tool-hardens-php-sites-against-cyber-attacks>`__ - The Daily Swig 89- `Snuffleupagus: Open source security tool hardens PHP sites against cyber-attacks <https://portswigger.net/daily-swig/snuffleupagus-open-source-security-tool-hardens-php-sites-against-cyber-attacks>`__ - The Daily Swig
90- `Snuffleupagus versus recent high-profile vulnerabilities <https://dustri.org/b/snuffleupagus-versus-recent-high-profile-vulnerabilities.html>`__ - dustri.org
91
922020
93""""
94
95- `Snuffleupagus, un excelente módulo para bloquear vulnerabilidades en aplicaciones PHP <https://www.linuxadictos.com/snuffleupagus-un-excelente-modulo-para-bloquear-vulnerabilidades-en-aplicaciones-php.html>`__ (es) - linuxadictos.com
96- `Выпуск Snuffleupagus 0.5.1, модуля для блокирования уязвимостей в PHP-приложениях <https://www.opennet.ru/opennews/art.shtml?num=53211>`__ (ru) - opennet.ru
97- `Snuffleupagus versus recent high-profile vulnerabilities, again! <https://dustri.org/b/snuffleupagus-versus-recent-high-profile-vulnerabilities-again.html>`__ - dustri.org
98- `Snuffleupagus, módulo para bloquear vulnerabilidades en aplicaciones PHP <https://underc0de.org/foro/seguridad-en-servidores/snuffleupagus-modulo-para-bloquear-vulnerabilidades-en-aplicaciones-php/>`__ - (es) - underc0de.org
99
1002021
101""""
102
103- `Sortie de Snuffleupagus 0.7.0 - Los Elefantes <https://linuxfr.org/news/sortie-de-snuffleupagus-0-7-0-los-elefantes>`__ (fr) - linuxfr
75 104
76 105
77Papers 106Papers