Re: Re: php4 /ext/standard file.c formatted_print.c
| From: | Andi Gutmans | Date: | Sun, 12 Jan 2003 06:00:48 +0000 |
| Subject: | Re: Re: php4 /ext/standard file.c formatted_print.c | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-93360@lists.php.net to get a copy of this message | ||
At 12:38 AM 1/12/2003 +0100, Sascha Schumann wrote:
On Sun, 12 Jan 2003, Moriyoshi Koizumi wrote: On Sun, Jan 12, 2003 at 12:12:39AM +0100, Sascha Schumann wrote:I might be misunderstanding the problem and I didn't have time to read the phrack article, but doesn't this mean that leaving it unsigned is better? It wouldn't pass the length check and thus, memcpy() wouldn't convert a negative number to something huge. AndiActually codes like below produce vulnerble runtimes because the length of string is expected to be a positive integer value...As many past security advisories have shown, signedness issues are the frequent cause for severe vulnerabilities in software (recent examples include MySQL, OpenBSD kernel).Yes, unfortunately. Basically the same problem as in the OpenBSD kernel and its select syscall:http://www.phrack.org/phrack/60/p60-0x06.txtQuote:Whilst there is a check [1] on the 'nd' argument (nd represents the highest numbered descriptor plus one, in any of the fd_sets), which is checked against the p->p_fd->fd_nfiles (the number of open descriptors that the process is holding), this check is inadequate -- 'nd' is declared as signed [6], so it can be negative, and therefore will pass the greater-than check [1]. Then 'nd' is put through a macro [2], in order to calculate an unsigned integer, 'ni', which will eventually be used as the the length argument for the copyin operation.