By mattm on
I got this from webhost:
Hello,
We have been reported the following problem:
> http://www.mydomain.com/system/files?file=images/../../../../../../../et...
>
> returns this:
> ASCII File: images-..-..-..-..-..-..-..-etc-hosts
>
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 localhost
> 209.59.190.2 adonis.site5.com adonis
Please fix this as soon as possible as your script can be exposing sensitive information to malicious parties. Thank you for your prompt attention to this matter.
I have no idea where the problem lies, and how to fix it. I haven't seen this URL anywhere on my site.
Comments
I edited my domain name
I edited my domain name above btw.
Reproducing
I have a site that makes use of the image module and tried to view the /etc/hosts file in the same manner in which your webhost did and got a 404 error on the site. I tried a few other files such as /etc/passwd and was unable to view the file contents. I am running Drupal 4.6.1 if that matters.
404 here too
Same here: page not found. I'm using Drupal 4.5.x.
Actually, this folder "system" *doesn't even exist*!
I think this is not related to Drupal.
Emiliano.
Check the files.inc in includes
Notice the last return line.
Tested on 4.5 with and without register globals set and cannot reproduce. Perhaps this persons host is misconfigured.
Have fun and check my Drupal Profile: http://drupal.org/user/519
Hummm... ok, I got it.
Hummm... ok, I got it.
I don't have this "system" folder because I always set file download as public.
Thanks,
Emiliano
http://www.novayork.com
Misconfiguration
I agree, I do believe this is a misconfiguration. If the OP could let us know the config, it might help.
What exactly do you need to
What exactly do you need to know?
I have my downloads set to private.
My drupal version is 4.6 with the latest security fix applied to the user module
Needed
Is you .htaccess default? What are the settings on your configuration. Web server, OS, PHP version are good starts.
Have fun and check my Drupal Profile: http://drupal.org/user/519
Webhost info:
Webhost info: http://209.59.190.2/
Server Hardware Specifications
Processors: Dual Pentium 4 Xeon 2.8 GHz w/ 1 MB cache & HyperThreading Technology
Memory: Minimum of 2 GB DDR ECC
Disk Drives: 2 x 200 GB SATA - 7,200 RPM 8 MB Cache
Connectivity: 2 x 10/100/1000 Intel Network Interface Cards
Operating system CentOS 4 Linux using the 2.6 kernel (enhanced by Site5 through custom security and performance modifications)
Webserver software: Apache 1.3.x
PHP version: 4.3.x (latest stable release)
MySQL version: 4.0.x
More details: Click http://metis.site5.com/info.php to see the output of phpinfo().
My htaccess file is the default one with some settings to prevent sessids in the urls.
Contents of htaccess file:
ok
Did you create the files directory in your document root? Which modules do you have installed and enabled? Which drupal version btw.
What I have found is that if you do not have a files directory and you have set drupal to handle file downloads that the file_exists function returns true for ?file=image/../../.. type entries. Without a files directory file_create_path returns the value of $_GET['file'] umodified. With a files directory it prepends files to the path.
Even when I move my files directory my drupal install doesn't give me the /etc/hosts file so I'm wondering which extra module that has a file_download hook is. Until then try creating a files directory if you don't have one.
Have fun and check my Drupal Profile: http://drupal.org/user/519
There was a bug in the
There was a bug in the flexinode module that was fixed several weeks ago.
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services
a couple comments
first off, this would be a file.inc issue not an image.module .
probably more important than your server config - what version of drupal are you running? please upgrade to 4.6.1 if you have not done so already.
--
James Walker :: http://walkah.net/