
Solid, safe website tools.
Whatever your need, Will Bontrager builds powerful software solutions.
|
(Get Attention Ticker for your web site)
Risks of Linking to Others' JavaScript FilesBy Will Bontrager This is a story with scary realizations. Mari and I have operated willmaster.com for, well, a long time. Over a decade. That's a lot of time for a lot of people to hotlink to our stuff. There is one type of hotlink I want to warn you about because it is a security risk. And that is hotlinking to other people's JavaScript files. Hotlinking to JavaScript Files Can Be DangerousWhether your hotlink is authorized or not, if you pull JavaScript from someone else's web site you will be at their mercy. Consider the possible consequences if they are inept or get mad at you or experience a sadistic pleasure by making you dance or have any other reason to deliver JavaScript different than what you expect. They might
perpetrate all manner of shenanigans. Those can be annoying or even frightening. In a moment, I'll tell you about some really dangerous stuff. Using Hotlink ALARM to Prevent HotlinkingI got to thinking about the possible consequences of hotlinking to JavaScript files on other people's web sites when I was setting up our own hotlinking protection. We're using Hotlink ALARM to prevent unauthorized hotlinking to JavaScript (and other) files. It doesn't actually prevent the hotlinking, but it does let you substitute other JavaScript, a replacement for what is hotlinked to. While I was deciding what JavaScript code I would put on web pages of those who are hotlinking to our JavaScript files without authorization, I realized I could play havoc. The more I thought about what could be done, the more alarmed I became. And I felt compelled to write this article to alert people to some of the dangers. Possible Consequences of Hotlinking to JavaScript FilesIn line with the purpose of this article, following are some dangerous things that can be done to you and your web site visitors, not an exhaustive list but hopefully enough to make thinking about this a priority. When you import JavaScript into your web pages from files or software on web sites others control, they can
perpetrate all manner of shenanigans. If they know your IP address, they can send benign JavaScript when you load your web page and dangerous JavaScript when others do. Think long and hard before inserting JavaScript into your web pages retrieved from a web site you do not control. The JavaScript Code Substitute I Decided UponI am not a vindictive person. My desire is to discourage hotlinking to willmaster.com JavaScript files to discourage, not to punish. As this article is being written, the replacement code being sent to web pages that hotlink to our JavaScript files without authorization is this: That prints, in large text, " Please do not hotlink to willmaster.com JavaScript files. (detected by Hotlink ALARM) " If you would like to see what we are currently using as a substitute, now that the time of writing this article is in the past, simply hotlink to one of our JavaScript files. Here's one you can use for testing: If the above doesn't work, if the src URL is a 404 for example (we're revamping willmaster.com and things will change), view the source code of this web page and find some JavaScript that retrieves code from an external file on willmaster.com. And use that for your test hotlinking. Put the above in a temporary web page on your web site and you can see for yourself how well HotlinkALARM works. January 31, 2008 Please note: Articles on this website are presented "as is". However - If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Rate this blog post.
No page reload! |
|
|
© 1998-2001 William and Mari Bontrager |
|