Welcome! Log In Create A New Profile

Advanced

Re: Equivalent of Apache's SetEnv Variable

August 05, 2010 06:02AM
On Thu, Aug 05, 2010 at 10:49:52AM +0200, Grzegorz Nosek wrote:

> On Thu, Aug 05, 2010 at 12:19:22PM +0400, Igor Sysoev wrote:
> > The issue is that someone is able to upload a image file to a directory
> > with scripts (I do not know why he is not able to override some valid
> > images or even the scripts themself in this case). Then someone requests
>
> I guess it comes from apache-land, where the simplest config is "run all
> .php files via the interpreter" (compared to nginx's "run all files under
> this directory via the interpreter"). The directory where the user is
> able to upload files is often a subdirectory of the application, as in:
>
> /index.php
> /foo.php
> /uploads
> /1.gif
> /2.png
> /images
> /foo.gif
>
> The more naive apps simply allow uploading of everything and store that
> under /uploads, while the smarter ones try to filter files for validity.
> So you cannot overwrite /foo.php or /images/foo.gif (barring directory
> traversal bugs...) but can upload /uploads/anythingyoulike.gif

Then it can be easy fixed by

location ^~ /uploads/ {
or
location ~ ^/uploads/ {

> > the image file as "/dir/1.gif/2.php" making exploit. I do not see
> > how using types will help in a case when nginx ahs not access to remote
> > filesystem.
>
> It won't help at all in that case. The proposed types would be a feature
> of the static module. It wouldn't be useful in single-huge-site
> deployments, only for sites running on a single server (Nginx+PHP).

I never liked this Apache idea of internal MIME-types such as
application/x-httpd-php, text/x-server-parsed-html, etc.
I believe it confuses and complicates things.


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Equivalent of Apache's SetEnv Variable

Raina Gustafson July 29, 2010 12:28PM

Re: Equivalent of Apache's SetEnv Variable

Eugaia July 29, 2010 01:24PM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev July 29, 2010 01:32PM

Re: Equivalent of Apache's SetEnv Variable

Raina Gustafson July 29, 2010 01:34PM

Re: Equivalent of Apache's SetEnv Variable

Raina Gustafson August 03, 2010 05:08PM

Re: Equivalent of Apache's SetEnv Variable

mike August 03, 2010 05:24PM

Re: Equivalent of Apache's SetEnv Variable

Raina Gustafson August 03, 2010 07:20PM

Re: Equivalent of Apache's SetEnv Variable

mike August 03, 2010 07:38PM

Re: Equivalent of Apache's SetEnv Variable

Raina Gustafson August 03, 2010 07:52PM

Re: Equivalent of Apache's SetEnv Variable

mike August 03, 2010 08:26PM

Re: Equivalent of Apache's SetEnv Variable

Ed W August 04, 2010 05:50PM

Re: Equivalent of Apache's SetEnv Variable

mike August 04, 2010 05:52PM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 02:48AM

Re: Equivalent of Apache's SetEnv Variable

mike August 05, 2010 03:10AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 03:32AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 03:20AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 03:38AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 04:12AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 04:12AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 04:18AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 04:26AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 04:54AM

Re: Equivalent of Apache's SetEnv Variable

mike August 05, 2010 05:18AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 06:02AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 06:22AM

Re: Equivalent of Apache's SetEnv Variable

mike August 05, 2010 06:26AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 06:46AM

Re: Equivalent of Apache's SetEnv Variable

mike August 05, 2010 06:52AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 07:04AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 07:16AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 07:18AM

Re: Equivalent of Apache's SetEnv Variable

Igor Sysoev August 05, 2010 06:50AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 06:52AM

Re: Equivalent of Apache's SetEnv Variable

mike August 05, 2010 03:42AM

Re: Equivalent of Apache's SetEnv Variable

Grzegorz Nosek August 05, 2010 04:14AM

Re: Equivalent of Apache's SetEnv Variable

mike August 05, 2010 04:18AM

Re: Equivalent of Apache's SetEnv Variable

Cliff Wells August 04, 2010 10:48PM

Re: Equivalent of Apache's SetEnv Variable

Ed W August 26, 2010 07:12AM

Re: Equivalent of Apache's SetEnv Variable

mike August 26, 2010 07:22AM

Re: Equivalent of Apache's SetEnv Variable

Jim Ohlstein August 26, 2010 10:28PM

Re: Equivalent of Apache's SetEnv Variable

Ed W August 27, 2010 11:00AM

Re: Equivalent of Apache's SetEnv Variable

mike August 04, 2010 06:20AM

Re: Equivalent of Apache's SetEnv Variable

Raina Gustafson August 04, 2010 10:58AM

Re: Equivalent of Apache's SetEnv Variable

mike August 04, 2010 04:04PM

Re: Equivalent of Apache's SetEnv Variable

Raina Gustafson August 04, 2010 11:14AM

Re: Equivalent of Apache's SetEnv Variable

mike August 04, 2010 04:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 187
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready