5

On many banking and investment websites, the site prevents users from logging in from an unrecognized computer without first answering an additional question or activating that machine. How do developers typically create this feature?

For example, here is the message that Salesforce.com gives when I connect to my account from an unrecognized machine:

Activate Required image, computer not recognized

We're trying to do the same type of thing from one of our applications, but aren't sure about the best (and most secure) approach.

Beep beep
  • 18,873
  • 12
  • 63
  • 78

6 Answers6

3

There are many possible approaches to do this, but typically they're using some combination of the following:

  • IP range you're connecting from
  • your host name
  • presence of cookies on your computer left by the site after a successful authentication
  • user-agent string

If you have too many differences from one of your existing trusted connections, the machine is considered untrusted. Where the line is drawn for "too many" is a tradeoff between security and convenience.

John Feminella
  • 303,634
  • 46
  • 339
  • 357
2

There is no truly secure approach, you could do it based on IP address, but that is often dynamic, you could do it on cookies but they're far from secure, you could do it on MAC address but you'd need to use Java (IIRC) to access that, but that again can be spoofed...

There is no real way to check if the computer they're connecting from has ever connected before. You can probably find "hacks" to sort of do it, but it's never going to be secure.

sam
  • 5,459
  • 6
  • 32
  • 53
  • I realize that once a computer is connected to another machine, there is never a 100% secure approach to anything. I'm just looking for the *most* secure way =) – Beep beep Feb 07 '10 at 20:40
2

You can set up a cookie on users machine and later on check if that cookie exists and contains a proper value. If the cookie doesn't exist, then this computer is a new one, otherwise this computer has been here before.

The cookies value can be some random hash, with different attributes, for example IP address, user agent, etc...

rATRIJS
  • 309
  • 1
  • 5
2

The Electronic Frontier Foundation (EFF) has set up a demo web site showing how astoundingly easy it is to identify a browser even if cookies are disabled or you are connecting from a different IP/provider:

Panopticlick: How unique - and trackable is your browser

They use a combination of

  • User agent string
  • HTTP headers
  • Installed browser plug-ins
  • Time zone
  • Screen size and color resolution
  • System fonts
  • Cookie settings

However, the typical scenario (and probably the one used in your sample application) would be to store a cookie locally and identify the returning user via this cookie.

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • Cool site! Our application requires cookies (corporate HR package), so we're not too worried about cookieless identification. Also, I can't imagine any of that data would be useful for our purposes - it would be a pain if the user needed to re-authorize every time the user upgraded Firefox, changed screen size, etc. Wouldn't it? – Beep beep Feb 07 '10 at 20:56
2

The most secure approach is undoubtedly to issue client certificates, and have the server check the certs on connection (make sure and use a revocation list!). This has quite a lot of administrative overhead, but works.

Andrew McGregor
  • 31,730
  • 2
  • 29
  • 28
0

Most top sites use Flash cookies to track unique visitors. Flash cookies are similar to regular browser cookies yet are not cleared when a user switches browsers or clears the browser history.

Read that again: you can try to clear your history or switch browsers, or even use chrome's "incognito" mode, and Flash cookies will still remember who you are. They're tied to the Flash install rather than the browser.

Wired has an article about them here: http://www.wired.com/epicenter/2009/08/you-deleted-your-cookies-think-again/

Despite Wired's warning about flash cookies, they themselves use flash cookies to track visitors. Go figure.

Within Flash, they're called "SharedObjects." See more on how to use them here: How do I access cookies within Flash?

Community
  • 1
  • 1
Ben Walther
  • 1,605
  • 10
  • 18
  • I doubt a banking, finance, or similarly secured site would use a flash cookie thought, right? – Beep beep Feb 08 '10 at 17:23
  • 1
    Bank of America's well-regarded SiteKey system depends on Flash Cookies (Shared Objects) in order to uniquely identify users. See their FAQ: http://www.bankofamerica.com/small_business/online_banking_and_services/index.cfm?template=faqs&statecheck=CA#sk_7 – Ben Walther Feb 09 '10 at 12:29