Hi, * Mark Baker <[email protected]> [2009-11-11 22:17]: > I believe this is a duplicate the many other bugs in PCRE; basically that > it's > possible to get stack overflows with certain regexes.
Ok. > It's not a major security problem, in that I don't think you can get > arbitrary > code execution by a stack overflow. It could possibly allow DoS attacks in > some > cases. Yes I agree, code execution looks also rather unlikely to me though DoS sounds like a realistic vector to me though not in all setups. > There are a couple of compile time options for PCRE that can ameliorate the > problem. One allows a maximum recursion depth to be set, which avoids seg > faults (so long as the stack space is large enough) but limits the regexes > that > can be used. The other stops it using recursion in this way, instead > allocating > memory on the heap to store state that would be on the stack in a recursive > call. Isn't it an option to have a maximum but make that configurable and the pcre function return an error if necessary? At least it shouldn't segfault. The heap allocation is an option though that would mean this code to be a lot slower due to added overhead for managing heap structures I guess, not? Cheers Nico -- Nico Golde - http://www.ngolde.de - [email protected] - GPG: 0xA0A0AAAA For security reasons, all text in this mail is double-rot13 encrypted.
pgpAzdjGVgmll.pgp
Description: PGP signature

