Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Raditha Dissanayake
hi, I think marek's recent message has answered this already, but i also believe that even in the older system where you have form fields like result in global variables like userfile_name etc the global variables don't get populated unless you send the correct enctype. best regards Alexand

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Alexander Mueller
Raditha Dissanayake wrote: > > Hi, > Multipart/form-data sends the entire file, if you don't use that enctype > yes, just the file name is sent. > > best regards I see, but then $_FILES is probably not set. So it wouldnt be necessary to use is_uploaded_file() if one solely uses $_FILES (but shou

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Marek Kilimajer
I tried: Fake: $_FILES superglobal still wasn't poisoned. Alexander Mueller wrote: Raditha Dissanayake wrote: This does not work with multipart/form-data you need www-urlencoded (or just don't set an enctype attribute in your form) What would happen in this case? The given filename would

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Raditha Dissanayake
Hi, Multipart/form-data sends the entire file, if you don't use that enctype yes, just the file name is sent. best regards Alexander Mueller wrote: Raditha Dissanayake wrote: This does not work with multipart/form-data you need www-urlencoded (or just don't set an enctype attribute in your f

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Alexander Mueller
Raditha Dissanayake wrote: > > This does not work with multipart/form-data you need www-urlencoded (or > just don't set an enctype attribute in your form) What would happen in this case? The given filename would be passed to the script?! Alexander -- PINO - The free Chatsystem! Available at htt

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Raditha Dissanayake
I don't think so. Test this, but I think you can just type /etc/passwd into the file name box (instead of using the "browse" button) and have that value submitted in the form. May be dependent upon the browser on how it's handled, though. This does not work with multipart/form-data you need www

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Marek Kilimajer
CPT John W. Holmes wrote: I don't think so. Test this, but I think you can just type /etc/passwd into the file name box (instead of using the "browse" button) and have that value submitted in the form. May be dependent upon the browser on how it's handled, though. You would send your own /etc/passw

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread CPT John W. Holmes
From: "Alexander Mueller" <[EMAIL PROTECTED]> > "Cpt John W. Holmes" wrote: > > > > The user can pass the name of a file on the server. If you're not doing any > > checks and moving or displaying the "file" the user "sent" you, you may end > > up moving, deleting, or displaying any file on your ser

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Alexander Mueller
"Cpt John W. Holmes" wrote: > > The user can pass the name of a file on the server. If you're not doing any > checks and moving or displaying the "file" the user "sent" you, you may end > up moving, deleting, or displaying any file on your server. > > ---John Holmes... Thanks John, but only in t

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Alexander Mueller
Marek Kilimajer wrote: > > By requesting upload_script.php?userfile=/etc/passwd and > upload_sript.php uses global variables to handle uploads. This check > should not be necessery if you are using $_FILES superglobal as php will > not accept _FILES user input. But keep the check there in case a b

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread CPT John W. Holmes
From: "Alexander Mueller" <[EMAIL PROTECTED]> > AFAIK the browser only sends the content of the chosen file and cannot > specify in any way a local filename which should be worked on. > Furthermore PHP creates a temporary file containing the uploaded file > content and passes this filename as 'tmp

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Marek Kilimajer
By requesting upload_script.php?userfile=/etc/passwd and upload_sript.php uses global variables to handle uploads. This check should not be necessery if you are using $_FILES superglobal as php will not accept _FILES user input. But keep the check there in case a bug will be introduced. Alexan

[PHP] is_uploaded_file() security

2003-10-22 Thread Alexander Mueller
Hi, I am wondering about the following paragraph at http://at2.php.net/manual/en/function.is-uploaded-file.php. > Returns TRUE if the file named by filename was uploaded via HTTP POST. > This is useful to help ensure that a malicious user hasn't tried to > trick the script into working on files u

Re: [PHP] is_uploaded_file() emulation?

2002-02-27 Thread Lars Torben Wilson
On Tue, 2002-02-26 at 13:22, Bogdan Stancescu wrote: > Hello all! > > How do I find out if a file was actually uploaded /without/ using > is_uploaded_file()? First: Why not use is_uploaded_file()? Second Second: What version of PHP are you using? Torben > My first though is that I should use

Re: [PHP] is_uploaded_file() emulation?

2002-02-27 Thread Edward van Bilderbeek - Bean IT
teley" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 27, 2002 12:37 AM Subject: Re: [PHP] is_uploaded_file() emulation? > Yeah, that's what I looked at before posting - but there's a catch: > "Returns the user ID of the **current script*

Re: [PHP] is_uploaded_file() emulation?

2002-02-26 Thread Bogdan Stancescu
; From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] ] > Sent: Wednesday, February 27, 2002 10:33 AM > To: Stewart Gateley > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] is_uploaded_file() emulation? > > > Thank you - but that wasn't the question - as you can

RE: [PHP] is_uploaded_file() emulation?

2002-02-26 Thread Martin Towell
try: http://www.php.net/manual/en/function.getmyuid.php -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 10:33 AM To: Stewart Gateley Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] is_uploaded_file() emulation? Thank

Re: [PHP] is_uploaded_file() emulation?

2002-02-26 Thread Bogdan Stancescu
Thank you - but that wasn't the question - as you can see, I started the second paragraph with a reference to that function - my problem is what I compare the result to - i.e. how do I find out *my* UID, not the file's. Mr. Kelly's solution should work, but it's rather absurd (from a PHP point

Re: [PHP] is_uploaded_file() emulation?

2002-02-26 Thread Stewart Gateley
$owner = fileowner ($file); returns a string containing the owner or false. see http://www.php.net/manual/en/ref.filesystem.php -- Stewart --- Bogdan Stancescu <[EMAIL PROTECTED]> wrote: > Hello all! > > How do I find out if a file was actually uploaded /without/ using > is_uploaded_file()?

RE: [PHP] is_uploaded_file() emulation?

2002-02-26 Thread Demitrious S. Kelly
Create a tmp file with the script and get the owner/group from that My $.02 -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 1:23 PM To: [EMAIL PROTECTED] Subject: [PHP] is_uploaded_file() emulation? Hello all! How do I find out if

[PHP] is_uploaded_file() emulation?

2002-02-26 Thread Bogdan Stancescu
Hello all! How do I find out if a file was actually uploaded /without/ using is_uploaded_file()? My first though is that I should use fileowner() on the file and see if it's the same as the user who runs PHP (Apache) - but how do I find that out? I don't want to use exec("id -u") either becau

Re: [PHP] is_uploaded_file

2001-12-28 Thread Jim Lucas [php]
ent: Friday, December 28, 2001 7:35 AM Subject: Re: [PHP] is_uploaded_file > I had 4.0.0 for a year or more and used that stuff quite well. > And the docs says : > "For earlier versions of PHP, you'll need to do something like > the following. > > Note: This will

Re: [PHP] is_uploaded_file

2001-12-28 Thread Andrey Hristov
I had 4.0.0 for a year or more and used that stuff quite well. And the docs says : "For earlier versions of PHP, you'll need to do something like the following. Note: This will not work in versions of PHP 4 after 4.0.2. It depends on internal functionality of PHP which chang

Re: [PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts
$userfile)) { > copy($userfile, "/place/to/put/uploaded/file"); > } else { > echo "Possible file upload attack: filename '$userfile'."; > } > ?> > > HTH > > Regards, > Andrey Hristov > > ----- Original Message - > From:

Re: [PHP] is_uploaded_file

2001-12-28 Thread Andrey Hristov
> - Original Message - > From: "Andrey Hristov" <[EMAIL PROTECTED]> > To: "Paul Roberts" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Friday, December 28, 2001 12:48 PM > Subject: Re: [PHP] is_uploaded_file > > &g

Re: [PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts
quot;Paul Roberts" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, December 28, 2001 12:48 PM Subject: Re: [PHP] is_uploaded_file > Read the docs about copy_uploaded_file() (this is the function with some more docs, as I remember). > > > HTH > > Andre

Re: [PHP] is_uploaded_file

2001-12-28 Thread Andrey Hristov
Read the docs about copy_uploaded_file() (this is the function with some more docs, as I remember). HTH Andrey Hristov - Original Message - From: "Paul Roberts" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 28, 2001 2:41 PM Subject: [PHP] is

[PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts
I'm on PHP/4.0.2 i'm getting Fatal error: Call to undefined function: is_uploaded_file() how can i emulate the function will also nag my host but... Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL P

RE: [PHP] is_uploaded_file false if file too big

2001-03-05 Thread Rick St Jean
nise it as an >upload. > >Cheers > > > > -Original Message- > > From: Rick St Jean [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 06, 2001 3:43 PM > > To: Tyson Lloyd Thwaites > > Subject: Re: [PHP] is_uploaded_file false if file too big >

[PHP] is_uploaded_file false if file too big

2001-03-05 Thread Tyson Lloyd Thwaites
Hi, I am having a problem with is_uploaded file returning false if the file uploaded is over a certain size. I have used ini_set("upload_max_filesize", "8M"), as well as setting MAX_FILE_SIZE like this: (ie real big :) Still, if I try to upload a file over about 2mb, is_uploaded_file returns f