-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: log and optionally terminate function_exists()-calls on non-whitelisted or blacklisted functions #31
base: master
Are you sure you want to change the base?
Conversation
…unction_exists() on blacklisted or not whitelisted functions
Dude ... all of my arguments in #18 were based around the fact that sudden script termination with no way to work around it is a huge pain in the ass. What's with the Otherwise, I'd consider E_WARNING a more proper log level, but since this is not part of the PHP core, I don't really care about it. :) Cheers. |
Without this patch there is no hint, that And paranoid people like me can turn the new And I made everything completely optional so upgrading won't change anything in your current setup, except suhosin being a little bit more verbose about what it does. Stephan |
I understand the need for logging and debugging tools for this in general, there is no argument over the logging part and that you need to know when something like this happens. What I don't agree on is having to terminate script execution when something like that happens. Obviously, it helps you during development and I don't know ... it may help somebody else in the same manner. At least that's a different argument to what you gave in my thread, but there's no guarantee that everybody would use it for the same purpose. Yes, it would be dumb to use it in a production environment, yes, whoever does that probably deserves all the heat they would get, etc. Still, it would eventually cause problems for end users. |
Can I convince you by changing the description of the two
? … 😇 |
…what they are meant for.
Those are indeed some very improved descriptions, but otherwise - no, IMO nothing can justify the existence of the |
Ack … 💤 |
I quickly googled, and found an exploit which would terminate earlier in a suhosin-setup having the
But as stated above, we appreciate any feedback we get - even negative. 😄 Stephan |
And that would get logged, while the functions will be unusable because they are blacklisted ... the exploit won't be halted during it's runtime, but won't do any harm either, so no win for the attacker ... why do you care if they are scratching their heads or they get the script terminated with possibly an error message? The latter would actually give them useful information. |
… I know this is a really special (and for production purposes a absolutely paranoid) requirement, but I'd like to have the chance to stop code execution if someone tries to detect the presence of functions before using them with the objective to hide his/her intrusion. So, I'll wait for more feedback. |
I never expected such a strong opinion against the stop-on-function_exists()-detection feature, but absolutely respect @narfbg 's fears, but I don't share them … it has always been hard to find a good balance between usability and security. That's why I made this feature optional, in the hope to trigger sane usage of it. What about other aspects of this patch, like:
@narfbg thx, for being so kind and actually read my stuff … really. Better critical, than no feedback at all. Which reminds me of being patient, in the hope of feedback from other users … 💤 |
You wouldn't, but as I said in a previous comment - there's no guarantee that nobody would.
Just like you're saying you wouldn't have Otherwise, again - I have nothing against the rest of this patch, it's just the Glad you like my feedback. I tend to get really hard into similar arguments (hence why you get it as a strong opinion from me alone) and people often confuse that with simply refusing to accept their apparently correct opinions. |
"are Off by default" +1 it is very annoying when things that are anally paranoid become default on (been there, experienced that) |
Not really sure if I like this idea/feature. Have to discuss internally. |
… I appreciate any feedback, especially which objections you have. And thanks for suhosin ! |
I learned in #18 the following: calls to
function_exists()
silently returnFALSE
, if the function to test for has been blacklisted or not whitelisted in one of the these configurations:The related discussion shows (to my mind), that the current solution leads to misinterpretations depending on the implementation and/or hosting environment. From a security point of view the silent return is a perfect solution, but during development or initial deployment of applications this might be annoying. Therefore I implemented a new error level/class S_EXISTENCE and used it to log and if one wishes also to terminate direct and indirect function_exists()-calls on blacklisted or non-whitelisted functions-names.
A (hopefully) complete list of changes and additions:
S_EXISTENCE
as a new log level; as it has never been part of the suhosin-patch it will always get registered, regardless of PHP being patched or notsuhosin.executor.func.exists_forbidden = Off
suhosin.executor.eval.exists_forbidden = Off
eval()
-statement.build and install, as well as
make test
have been successfully run on:https://github.com/NewEraCracker/suhosin-patches/tree/master/patches
https://github.com/NewEraCracker/suhosin-patches/tree/master/patches
@narfbg : this pull-request enhances #18 … at least I hope so.
I hope i didn't miss something and more important, I hope you like this solution …
Gut's Nächtle,
Stephan