Skip to content
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

suhosin.executor.eval.blacklist sometimes applied erroneously #82

Open
blackwind opened this issue Apr 29, 2015 · 7 comments
Open

suhosin.executor.eval.blacklist sometimes applied erroneously #82

blackwind opened this issue Apr 29, 2015 · 7 comments
Labels

Comments

@blackwind
Copy link

On PHP v5.6.7, I'm finding Suhosin v0.9.37.1 sometimes decides to disable the functions provided in suhosin.executor.eval.blacklist when NOT in an eval context. When this occurs, these functions remain disabled indefinitely until PHP-FPM is restarted. Thus far, I've been unable to find any method to the madness -- one second my scripts work, and the next, they don't. Thoughts?

@bef
Copy link
Member

bef commented Apr 30, 2015

Can you provide an example blacklist and php-script for us to recreate the issue?

@bef bef added the bug label Apr 30, 2015
@blackwind
Copy link
Author

Something as simple as this works when the bug is triggered:

suhosin.executor.eval.blacklist = phpinfo

<? phpinfo(); ?>

The million-dollar question is, how does one get the bug to trigger? That I haven't figured out quite yet, and frankly, I'm not sure I ever will. To my eyes at this stage, it truly does appear to be totally random.

@NewEraCracker
Copy link
Contributor

Just out of curiosity. Are you running OPCache or any other zend extension ?

@blackwind
Copy link
Author

I'm running OPcache, yep. That's my only zend_extension.

@NewEraCracker
Copy link
Contributor

Can you reproduce this random wrongful behavior if OPcache it is not enabled ?

My guess is that OPcache could cache function calls and if one function is suddenly blocked by Suhosin in eval mode, then that very same function would be blocked for every mode due to OPcache caching such result. This is a long shot and more research is necessary as I haven't poked around OPcache code yet.

@blackwind
Copy link
Author

An excellent theory, but alas, it didn't check out. With two simple test scripts, one calling a blacklisted function with eval, one calling it without, the one without continued to function after the blacklist was triggered.

I'll try running without OPcache for a few days and report back.

@Aaron-
Copy link

Aaron- commented Apr 21, 2016

Maybe related, but we are seeing some false positives as well, for example:
suhosin[10309]: ALERT - function within eval blacklist called: base64_decode() (attacker 'x.x.x.x', file '/home/user/domains/domain.com/public_html/craft/app/services/UserSessionService.php', line 830)

Line 830:
return $this->getStateCookieValue('username');

The getStateCookie function indeed does use base64_decode, but there is no eval used in there.

@blackwind blackwind changed the title suhosin.executor.eval.blacklist sometimes applied erroneously suhosin.executor.eval.blacklist sometimes applied erroneously Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants