-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit d91c592
Disable ZEND_MM_CUSTOM by default.
PHP's heap implementation is the one that virtually everybody uses: it's fast,
it's there by default, it works, ...
The only major ever I've found of custom heap implementation [is
phpdbg](https://github.com/rogercaetanos/php-src/blob/e39db5773d9443e2cfee92bc31651848c044c325/sapi/phpdbg/phpdbg.c#L968-L999)
but it looks dispensable at best. Some other debuggers and profilers might use
it, and that's alright, but I don't think that this feature should be enabled by
default.
Disabling ZEND_MM_CUSTOM will allow to save a couple of bytes (yay), but the
main goal is to close a low-hanging exploitation vector: as [presented at
OffensiveCon 2024](https://youtu.be/dqKFHjcK9hM?t=1622), having trivially
callable writeable function pointers at the top of the heap makes it
straightforward to turn a limited write into an arbitrary code execution.1 parent 37488d6 commit d91c592
1 file changed
+1
-1
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
139 | - | ||
139 | + | ||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
|
0 commit comments