Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-21-2006, 10:20 AM   #1 (permalink)
frostyservant
Master of the Universe
 
frostyservant's Avatar
 
Join Date: Feb 2006
Posts: 13
frostyservant is on a distinguished road
Concerning Apache problem...

I'm not sure if this is the correct forum for this thread; if it is not, my apologies.

Concerningly enough, IE7 seems to bypass .htaccess somehow on Apache. The user is still presented with a username/password prompt, but canceling this will allow them to browse a good deal of the website's content. Just from visually observing the process, it seems as if webpage content is downloaded until the prompt is generated.

When browsing in Firefox (and, as far as I can remember, IE6), Apache behaves appropriately; but, of course, in server-side security, one has to assume the user will take advantage of any flaws.

Has this always been a problem in Apache, or has this problem newly emerged with IE7? Is there some mistake I'm making with regards to security?

For reference, here's an edited version of the .htaccess file in question:

Code:
AuthName "Who goes there?"
AuthType Basic
 
AuthUserFile [absolute location of .htpasswd file]
 
AuthGroupFile /dev/null
 
<Limit GET POST>
require user [username]
</Limit>
frostyservant is offline   Reply With Quote
Old 02-21-2006, 10:59 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
i haven't experienced the problem you mention. here's the format of one i use.
Code:
AuthGroupFile /dev/null
AuthName "authorized users only"
AuthType Basic
AuthUserFile <path to .htpasswd>
require valid-user
sde is offline   Reply With Quote
Old 02-21-2006, 11:26 AM   #3 (permalink)
frostyservant
Master of the Universe
 
frostyservant's Avatar
 
Join Date: Feb 2006
Posts: 13
frostyservant is on a distinguished road
Hmmm... both configurations of .htaccess produce the same result; although upon further investigation I've discovered that the problem exists for Firefox as well... I may need to take this up with my hosting company (GoDaddy).
frostyservant is offline   Reply With Quote
Old 02-21-2006, 12:06 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
do they have an interface that creates the password protection? or do you do manually do it?

if they have a control panel option, i would remove it and try to create it again.
sde is offline   Reply With Quote
Old 02-21-2006, 12:12 PM   #5 (permalink)
frostyservant
Master of the Universe
 
frostyservant's Avatar
 
Join Date: Feb 2006
Posts: 13
frostyservant is on a distinguished road
Nope, I wrote the .htaccess file manually.

EDIT: The problem doesn't seem to be cropping up when I try to access the protected folder itself, just files within that folder.
frostyservant is offline   Reply With Quote
Old 02-21-2006, 12:34 PM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
do you have shell access to your web server? i remember a while back i was working on getting .htaccess to work with my .htpasswd file and i was having trobule. i found this command to create the .htpasswd file and it ended up working out.
Code:
$ htpasswd -c .htpasswd <username>
you would need shell access to the server to execute that though. also, you would need to be in the directory where your .htpasswd file is stored to use that exact format.
sde is offline   Reply With Quote
Old 02-21-2006, 12:36 PM   #7 (permalink)
frostyservant
Master of the Universe
 
frostyservant's Avatar
 
Join Date: Feb 2006
Posts: 13
frostyservant is on a distinguished road
Unfortunately, no; I don't.

Thanks for all this assistance, btw.
frostyservant is offline   Reply With Quote
Old 02-21-2006, 12:39 PM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
no problem. please update me with what you find out. i'm curious how godaddy handles it as i run a little hosting company myself. i'm surprised the hosting control panel they run doesn't support that.
sde is offline   Reply With Quote
Old 02-21-2006, 12:40 PM   #9 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 596
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Remember, the webrowser never sees .htaccsess files, so either the apache webserver executes it or it doesn't. It could be that your hosting company doesn't support the directives you have supplied, or doesn't even read .htaccess files. Maybe they upgraded recently and changed something?
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 02-21-2006, 12:43 PM   #10 (permalink)
frostyservant
Master of the Universe
 
frostyservant's Avatar
 
Join Date: Feb 2006
Posts: 13
frostyservant is on a distinguished road
It's possible something changed, but I would find it easier to understand if .htaccess no longer worked at all. Instead, users are presented with a prompt, but for some reason the server doesn't wait for them to supply credentials before serving data.

EDIT: Hmmm... I thought it might be a chmod problem, tried changing some of that, it didn't work. Now files have their original values again (.htaccess and .htpasswd at 644, everything else at 755), but .htaccess doesn't work at all.

Last edited by frostyservant; 02-21-2006 at 01:13 PM.
frostyservant is offline   Reply With Quote
Old 02-22-2006, 06:36 PM   #11 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
must be issue with .htpasswd having empty entry or something.
.htpasswd should be 622 (only readable) for best security

I don't have that issue in one of my PHP apps since PHP itself handles the authorization for me.
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
parse error problem in game.. can't seem to find problem solution. slashdot Standard C, C++ 5 08-03-2005 08:15 PM
JSP code problem j.gohel Java 7 04-15-2005 02:07 PM
Problem Assignment (Urgent help req.) Boltress Standard C, C++ 0 01-12-2005 07:59 AM
Help debugging a power problem Belisarius Lounge 0 10-25-2003 04:44 PM
fresh apache install sde Linux / BSD / OS X 3 01-05-2003 10:53 AM


All times are GMT -8. The time now is 11:38 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting