473,473 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Security and spurl.net (and others)

I found an interesting JS technique being used by spurl.net and a few
other sites, and implemented my own version of it. I like using it, but
I'm rather surprised it works at all.

One of my old backburner projects has been an online bookmark archive.
The obvious advantage of keeping bookmarks on a remote host is that
they are available from anywhere, not just the computer they were
bookmarked from.

My original approach was to use a page that would open a child window.
You'd surf in the child window and when you wanted to bookmark a site,
you'd switch to the parent window and hit a button. Worked great until
I tried to bookmark a site that was not in the same domain. That's how
I learned about the 'same domain' security policy 8-0

Spurl uses a small piece of JS code as a pseudo-url in a link, which
the user bookmarks, putting it on the browser's toolbar. When the user
clicks on the link on the toolbar, the JS code executes, opening a
window and calling a url, passing the current page's url and title in
the query string.

It's pretty slick really. But doesn't it seem to violate the 'same
domain' policy that keeps me from reading the title and url of a child
window?

I've implemented my own clone which asks for comments and keywords, and
doesn't save or submit until the user tells it to. But actually by the
time the user sees the popup contents, the server has already seen the
information. I also know it's possible to write one of these pseudo-url
popups to open and close a window without user intervention.

I really haven't taken the time to see just what other information one
of these popups can gather from the "current page" (never thought
about it until now) but the issue is that a little piece of code can
access the document object of a page across domains.

Any comments?

Jul 23 '05 #1
2 1271
VK
> But doesn't it seem to violate the 'same
domain' policy that keeps me from reading the title and url of a child
window?


As I see it there is not a JavaScript sandbox violation here, because
the actuall process goes on the server side. By clicking
javascript:void(someDomain/some.php) you're effectively calling a php
script on the server from your current page. Naturally php page has the
caller's URL right away as it's a part of CGI (OK, PHP uses CGI as a
transport for it's own protocol, but it doesn't change the picture too
much). "To fully satisfy customers", one could create server-side
virtual browser to get own copy of that page and study it on the spot
(title, language, links, number of paragraphs etc.)
Nothing to do with JavaScript security. Just the old as WWW dilemma:
convenience / privacy = const
More convenience - lesser privacy
Lesser privacy - more convenience

Jul 23 '05 #2
Razzbar wrote:
<snip>
... a pseudo-url in a link, which the user bookmarks,
putting it on the browser's toolbar. When the user
clicks on the link on the toolbar, the JS code executes,
opening a window and calling a url, passing the current
page's url and title in the query string.

<snip>
Any comments?

A javascript pseudo protocol URL typed into the location/address bar of
the browser is executed as part of the current page, inside its script
environment. As a result it has exactly the same rights to access the
contents of the contained document as any other script on that page.

Javascript pseudo protocol URLs may also be set up as
favourites/bookmarks in the browser, as buttons on the toolbar, links on
the desktop (dragged onto the browser window to execute), and in many
other ways. Rendering a running document form any location wide open to
examination and manipulation.

They are used extensively in development to examine/modify the current
state of scripted document for testing and debugging. And they are used
"maliciously" to negate all notions of client-side security.

They provide the user of a web browser with absolute control over the
software that is executing on their computer. Just as it should be, as
there are no security implications for the user in having that power
over remotely originating code.

Richard.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Angelos Karantzalis | last post by:
Is there a way to set Permissions based on user roles by using some configuration file for my application ? I'm coming from a Java background, where that could very easily be accomplished but...
1
by: mar10 | last post by:
Ok I'm still trying to figure out security for a small database I'm doing for a firm with 4-5 employees. I'm trying to read as much as possible before I give it a try because it sounds like some...
7
by: Stephen | last post by:
I have my intranet setup on our web server. It contains multiple applications, but none are set up in the default application pools. In other words, I create a webform and plop it into a...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.