Comments (5)
Suhosin7 is doing it like us, but I don't think that they tested it.
from snuffleupagus.
This is what our function looks like:
static int sp_stream_open(const char *filename, zend_file_handle *handle) {
zend_execute_data const * const data = EG(current_execute_data);
if ((NULL == data) || (NULL == data->opline)) {
goto end;
}
switch(data->opline->opcode) {
case ZEND_INCLUDE_OR_EVAL:
if (true == SNUFFLEUPAGUS_G(config).config_readonly_exec->enable) {
terminate_if_writable(filename);
}
construct_include_handler(filename);
}
end:
return orig_zend_stream_open(filename, handle);
}
Apparently, data->opline
is equal to 0x2
, and thus can't be dereferenced to access the opcode
member. This doesn't make any sense.
Some values are garbage in the data
structure, but apparently in php, it's an accepted behaviour, and doesn't necessary means that there is a bug somewhere :/
from snuffleupagus.
People are doing additionnal checks:
} else if (
data &&
data->prev_execute_data &&
data->prev_execute_data->func->type == ZEND_USER_FUNCTION &&
data->prev_execute_data->opline &&
data->prev_execute_data->opline->opcode == ZEND_INCLUDE_OR_EVAL
) {
So I did the same (because I'm lazy and it's getting late). Care to test them @xXx-caillou-xXx ?
from snuffleupagus.
It looks like it's working.
from snuffleupagus.
from snuffleupagus.
Related Issues (20)
- .deb doesn't ship PHP8 rules HOT 1
- undefined symbol: PHP_SHA256Init HOT 6
- PHP 8.3 compatibility HOT 3
- XXE and Nextcloud HOT 2
- none-standard symbols brake executions of rules HOT 2
- upgrading from older versions to latest HOT 1
- Snuffleupagus did;nt work as expected HOT 3
- Snuffleupagus for php 7.4 latest HOT 2
- Clarify `match` comparisson for filters
- Support filter `param` multiple times HOT 3
- SP doesn't work with phar files
- Snuffleupagus 0.10.0 when loaded via Apache only applies ruleset when it has no comments HOT 9
- V10 debian packages missing HOT 3
- PHP-FPM 8.3 child exited with code 70 HOT 3
- Patchstack Wordpress Vulnerability DB HOT 1
- Snuffleupagus associated with high CPU load HOT 6
- How can i fix the mail issue? HOT 1
- generate_rules.php: why forbid curl_exec and curl_multi_exec? HOT 9
- generate_rules.php: remove assert if running PHP8+ HOT 1
- Support for PHP 8.3 on Alpine Linux HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snuffleupagus.