Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Andre Dubuc
Thanks Rasmus, I thought there had to be function out there that could examine the actual contents. Now the question remains, would an ereg/eregi check for html/code/commands work on a "jpg/jpeg" type file? From a brief examination of one, I note that it's not text, but code. I tried writing

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Jim Winstead
Rasmus Lerdorf <[EMAIL PROTECTED]> wrote: > Are you afraid of someone embedding PHP in a .jpg file? That's not really > an issue as your web server is probably configured to only serve up PHP as > .php files. Likewise, your web server config is likely such that any .jpg > file is served up as co

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Rasmus Lerdorf
Are you afraid of someone embedding PHP in a .jpg file? That's not really an issue as your web server is probably configured to only serve up PHP as .php files. Likewise, your web server config is likely such that any .jpg file is served up as content-type image/jpeg and as such it really doesn'

[PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Andre Dubuc
My question will probably expose my woeful lack understanding of security breaches, but perhaps someone can enlighten me. On my site, registered members will be allowed to upload jpg/jpeg pictures. I'm concerned about possible security problems. First, is there a way to ensure that a picture (

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-15 Thread Tom Rogers
Hi What I do is use the function GetImageSize(), if that returns x and/or y = 0 it probably isn't an image file and dump it. Tom At 05:06 AM 16/05/2002, you wrote: >On Wed, 15 May 2002, Andre Dubuc wrote: > > Actually, I figured out how to do it: a combination of checking: > > if ( $_REQUEST['p

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-15 Thread Jason Wong
On Thursday 16 May 2002 03:06, Miguel Cruz wrote: > On Wed, 15 May 2002, Andre Dubuc wrote: > > Actually, I figured out how to do it: a combination of checking: > > if ( $_REQUEST['pix']['type'] == "image/jpeg")} blah, blah, blah > > I'm pretty certain that the 'type' that appears here is just d

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-15 Thread Miguel Cruz
On Wed, 15 May 2002, Andre Dubuc wrote: > Actually, I figured out how to do it: a combination of checking: > if ( $_REQUEST['pix']['type'] == "image/jpeg")} blah, blah, blah I'm pretty certain that the 'type' that appears here is just derived from the file name, and therefore is not trustworthy

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-15 Thread Andre Dubuc
Thanks Miguel, Actually, I figured out how to do it: a combination of checking: if ( $_REQUEST['pix']['type'] == "image/jpeg")} blah, blah, blah and then using 'fread' on the actual file itself, applying my 'eregi' verification code. It works! The problem before was that I was attempting

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-15 Thread Miguel Cruz
On Tue, 14 May 2002, Andre Dubuc wrote: > My question will probably expose my woeful lack understanding of security > breaches, but perhaps someone can enlighten me. > > On my site, registered members will be allowed to upload jpg/jpeg > pictures. I'm concerned about possible security problems.

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-14 Thread Rasmus Lerdorf
Have a look at the getimagesize() function. This function looks at the actual file data, not the mime type nor the file's extension but the data itself and tells you what sort of image file it is. And no, it wouldn't really be after the fact because because stores the file with a temporary rando

[PHP] Uploading JPEG's - Security Issues?

2002-05-14 Thread Andre Dubuc
My question will probably expose my woeful lack understanding of security breaches, but perhaps someone can enlighten me. On my site, registered members will be allowed to upload jpg/jpeg pictures. I'm concerned about possible security problems. First, is there a way to ensure that a picture (