How to block local file access to my server

74 views
Skip to first unread message

Ket

unread,
May 30, 2014, 4:13:54 AM5/30/14
to nod...@googlegroups.com
Hi there,

I could block other web sites access to my server with this simple logic:

var mydomain = 'http://www.mywebsite.com/';
if(url !== 'mydomain') {
   return;
}

However, it could not block request from a local computer's file like from this location:

file:///D:/test.html

How do you prevent request from this location to access to the server and stealing bandwidth and sensitive data.

Do you even think this is a security issue. I'm worried too much about this insecure.

Thank you

Darren DeRidder

unread,
Jun 1, 2014, 10:22:43 AM6/1/14
to nod...@googlegroups.com
Ket, could you post a gist with code to demonstrate what you're asking about? My first thought was blocking on the basis of the request URL won't prevent access from different remote hosts, but I'm not sure I understood your question.

Ryan Schmidt

unread,
Jun 1, 2014, 10:30:51 AM6/1/14
to nod...@googlegroups.com
I don't understand your concern. If you can access a file via the file: protocol, then you are accessing the file from a local drive usually; you're not going over a network; no bandwidth is being used.

I also don't understand your first statement about blocking access from other web sites. If your URLs are public, then anyone can access them. If you want to prevent access, password-protect.

Reply all
Reply to author
Forward
0 new messages