| Age | Commit message (Collapse) | Author |
|
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible
* SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read
* execution_depth is re-initialized to 0 for each request
* function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1
* execution is actually hooked if recursion protection is enabled
* some line breaks were removed to make the code more readable
|
|
|
|
fixed related unittests
|
|
This shouldn't be necessary, but better safe than sorry.
|
|
|
|
|
|
This commit allows php to run (with a warning) if there
is no specified snuffleupagus configuration,
instead of refusing to start.
|
|
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
|
|
|
|
|
|
This is due to our modifications to the logging system
|
|
|
|
|
|
|
|
|
|
* `setcookie` doesn't always return `true` anymore
* clang-format
* Cookies with invalid decryption are dropped, but the request isn't anymore
* faulty unserialize are now dumpable
|
|
|
|
|
|
This commit does two things:
- Implement matching on calltraces for ret
- Implement matching on ret of user functions if the return value is not used.
|
|
|
|
There are valid reasons for `orig_zend_execute_internal`
to be `NULL`, we we're not checking if it is,
well, `NULL`.
|
|
|
|
We might have ended up in infinite loops when using
php-fpm, if several different process hooked
some functions twice.
Thanks to @sriccio for reporting the issue
|
|
|
|
|
|
This commit does a lot of things:
- Use hashtables instead of lists to store the rules
- Rules that can be applied at launch time won't be tried at runtime
- Improve feedback when writing nonsensical rules
- Make intensive use of `zend_string` instead of `char*`
|
|
* Trying to fix sloppy comparison https://github.com/nbs-system/snuffleupagus/issues/10 by
modifying php's opcode
|
|
|
|
|
|
Only check if a function should be disabled when we're after a `*CALL` opcode, end not on every single opcode.
Based on @blotus ideas ♥
|
|
|
|
|
|
Some extensions might hook `zend_execute_internal` for various reason,
although few are doing it. We're not supposed to call the original
function in our hook if someone else is hooking it.
Thanks to @remicollet for the bug report and troubleshooting
|
|
|
|
This should close #85
|
|
|
|
|
|
Implement whitelist in eval
|
|
|
|
Add support for eval filtering, only blacklist for now
|
|
- `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h`
- Update the documentation accordingly
|
|
This should close #99, thanks to @blotus for the implementation idea!
|
|
Since we now have sp_list and sp_tree, it makes sense to specify that
nodes are only for lists.
|
|
|
|
It's not possible to hook the `eval` builtin like other functions.
|
|
|
|
Courtesy of @buixor
|
|
`regexp` is more confusing than `value_r`
|
|
- We shouldn't assume that people are only using regexps
- Make an internal function a bit more obvious
|
|
|