summaryrefslogtreecommitdiff
path: root/src/sp_unserialize.c (unfollow)
AgeCommit message (Collapse)Author
2026-03-28Fix the usage of strlen() which will return a wrong size when serialized ↵W0rty
objects contains null bytes (for example in private fields)
2025-10-24fix(unserialize): don't bail in simulation mode when there's no HMACjvoisin
2024-06-06Silence unused variable warning with php 8.3Christian Göttsche
src/sp_unserialize.c: In function 'zif_sp_unserialize': src/sp_unserialize.c:131:15: warning: unused variable 'orig_handler' [-Wunused-variable] 131 | zif_handler orig_handler = zend_hash_str_find_ptr(SPG(sp_internal_functions_hook), ZEND_STRL("unserialize")); | ^~~~~~~~~~~~
2023-06-25Fix an unserialize-related warningjvoisin
This should fix `Warning: unserialize(): Extra data starting at offset 8 of 72 bytes in unserialize.php on line 4`. On the flip side, it's not longer possible in PHP8.3 and above, when using Snuffleupagus, to have other extensions hooking unserialize().
2022-12-08Add unserialize_noclassjvoisin
2022-12-07Minor refactorjvoisin
2022-05-03Help the compiler to optimize sp_do_hash_hmac_sha256 a morejvoisin
2022-03-20Fix compilation on PHP<7.2jvoisin
2021-12-13fixed use after free + PHP 7 compatibilityBen Fuhrmannek
2021-11-19replaced call_user_func with C level callBen Fuhrmannek
2021-10-21added some array initialization, just in case.Ben Fuhrmannek
2021-09-23config is stack allocated now + some code improvements (see details)Ben Fuhrmannek
* 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
2021-08-16fincy new scanner/parser for config rules + fixed a few bugs along the way + ↵Ben Fuhrmannek
fixed related unittests
2021-08-03simplified string concatBen Fuhrmannek
2020-07-22refactoring sp_log_* (#340)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2020-07-04Run clang-format on the codebasejvoisin
2019-06-20Fix snufflepagus_globals linking issues and one mac compatibility issuebef
2019-06-19fix snufflepagus_globals linking issues and one mac compatibility issueBen Fuhrmannek
2018-10-06Bump coverage againjvoisin
2018-10-06Bump a bit the coveragejvoisin
* `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
2018-10-06Remove sp_terminate and bump a bit the coveragejvoisin
2018-09-03Fix #241 segfault on 32-bit related to bad protype (#242)Remi Collet
This should close #241
2018-08-30Minor code cleanupxXx-caillou-xXx
2018-07-13Yet an other pass of clang-formatjvoisin
2018-07-13Fix various possible integer overflowsxXx-caillou-xXx
2018-07-13Massively optimize how rules are handledxXx-caillou-xXx
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*`
2018-03-02Implement dump() for execution of writable PHP fileskkadosh
2018-02-27Implements .dump() for unserialize and fix some related testskkadosh
2018-02-05Massive simplification of functions hookingjvoisin
2018-01-15Fix some memleaksjvoisin
2018-01-04Eval blacklistjvoisin
Add support for eval filtering, only blacklist for now
2018-01-03Remove some dead codejvoisin
2017-12-28Clang-format passThibault "bui" Koechlin
- `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h` - Update the documentation accordingly
2017-10-30Fix a silly and useless off-by-onejvoisin
2017-10-18.drop() is not a `nop` anymoreThibault "bui" Koechlin
`.drop()` is now baillout out, instead of nop'ing the call. This closes #13
2017-10-10Make the `simulation` mode logs more obviousjvoisin
2017-09-21Add travisjvoisin