Request for Comments: Challenge-Response Digest Authentication for webapps?

Hi All…

I know many of you are in the web development and security arenas… I figured I’d throw this idea up for everyone to have a look at.

Authenticating users on a website can be quite a challenge at times.  Sometimes, HTTP Basic authentication is all that’s required, re-sending the password with each request.  But the problem with this; is that someone can intercept the username and password, thus knows everything needed to establish a new session.

HTTP Digest authentication is good; but MD5 isn’t as strong as other hashing algorithms available, and more importantly, it assumes the server knows the exact password.  But what if you’re hashing the password?  Also, this doesn’t necessarily solve the issue of session hijacking.

Thus what I have come up with, is “Challenge-Response Digest Authentication”.  My rationale for this method of authentication and session management is as follows:

  1. Remove the need for the cleartext password to be stored or transmitted.  Using CRDA, only the hash of the password needs to be stored.
  2. The remote user still needs to demonstrate knowledge of the password (or rather, its hash)
  3. Various aspects of the client, such as the IP address and user agent, are used when generating the hash, making session hijacking more difficult.

So, how does this actually work?  Well, in a web application scenario, it requires JavaScript on the client side to implement the hashing algorithm (in my case, I’ve settled on SHA1).  The initial authentication phase works as follows:

  1. Remote client makes a request to log in by requesting the login form.
  2. The server generates a session ID, which is the hash of the following (in this order):
    • IP Address of client (from the server’s perspective)
    • Client User Agent
    • A random salt string
  3. The server responds by sending back the requested form; Included on the page in the JavaScript code, are values for a random salt and the IP address of the client.  A cookie containing the session ID could also be included — or on more advanced clients, could be determined by the client.
  4. On submitting the form, client side JavaScript takes the information provided, and generates a hash of the following data (in this order):
    • IP Address of client
    • User Agent in use
    • The random salt given
    • The username
    • The hash of the password

    The cookie generated earlier is passed back to the server as well so it can look up the salt value.

  5. The server receives the session ID (via cookie) as well as the username and response (via HTTP POST), looks up the salt for that session ID, then checks the following:
    • The session ID is valid for the given IP and user agent
    • The response is valid

If successful, the server generates a random nonce value, and passes this back to the client.  The session key to be used from this point forward, is the hash of the following information:

  • IP Address
  • User Agent
  • Random Salt
  • Nonce value

The nonce is then updated at regular intervals.  On an intelligent client, the raw nonce value could be passed back right at the start, and stored — the client incrementing it when told by the server.  On a simpler client, the key may get passed back and forward.

For each request after this initial authentication step, a cookie should be passed to the server containing the following string: “SessionID:SessionKey”.

Anyways… those are my ideas.  I know there are problems with this; most notably, is the effectiveness of hashing when you hash something twice.  I know that SHA1 is less effective in this instance — but the question is, how much less effective?  I figure it’s not really enough to be worried about, but then again, I know there are people who work in this field, and thus will know more about it than me.

I’m still tinkering at this stage, I’ve got a small proof-of-concept webapp going that utilises this scheme at a basic level, and I’ll keep poking at it for now, but I’d be interested in hearing other people’s thoughts on whether this would be effective against preventing session hijacking and keeping a site secure.

Gentoo/MIPS Cobalt 2007.0: MIPS-I Stages Released

Hi,

As promised, some stages compiled for MIPS-I have been released.  These stages should be appropriate for almost all little-endian MIPS hardware equipped with a decent amount of memory (128MB or more).  This should make things a little easier for those wishing to install Gentoo on MIPS32 hardware such as AMD Alchemy development boards.

Note, anything kernel or bootloader related, we can’t help with.  It’s assumed you know what you’re doing as far as actually preparing a bootable kernel and configuring your firmware to boot Gentoo.

Next on the list, is to look into µClibc stages for Cobalt — which will hopefully be used to produce updated netboot images for Cobalt.  So yeah, I’ve been absent for the last week or so, de-stressing and getting uni sorted out.  In short, it’s all system’s go now.

Sanity Break

Hi All…

At the moment, stresses are running high.  Exactly why, I’m not sure, but it seems everyone is on edge.  And I don’t just mean the Gentoo Development community — I mean elsewhere too.  Everyone seems to be edgy for reasons I cannot fathom.

I’m not going to speculate about what could be causing this stress… I know in my case, the tense atmosphere has had an impact.  I’m nowhere near the point of doing anything irrational like suicide (I know this will create more problems than it will solve), but I am noticing that I’m not in my usual “stable” mental state.  I think in my case, there are a few factors in play…

  • At university, I’m doing a subject entitled “Core Project Initiation”, which heavily depends on groupwork.  We have to form groups of 5 people or so, choose a project, find a project supervisor (typically other lecturers at QUT), then work towards implementing a prototype.  The first assessment item, is due this Friday, and more or less requires the group to be formed.  After having two attempts at forming a group fail, I’ve been in contact with the lecturers and am in urgent need to get into a group.  Basically, if by Wednesday, I’m not in a group — I’ll pull out of the subject, it’s just not going to be viable for me to continue.
  • Last semester was rather stressful, having had two major stuffups by the university (in one case, a lost exam paper; in a second, a breech of examination procedure), and winding up failing a telecommunications subject for seemingly unknown reasons.  A total lack of feedback was a big factor — there was nothing to suggest I was offtrack, yet, I got a 2 (7-point scale) as my grade for the subject in question.
  • I’m still looking around for work.  I’m quite conscious that I’m basically living out of my father’s back pocket — have been for some time now.  This has been playing on my mind a lot lately.  I know that without any work, I can forget passing my degree, I can forget moving out of home at some point.  And luxuries like attending LCA2008 are definitely out of the question.  I’ve applied to several positions over the last few months without success.
  • The weather has been rather hot and humid lately, enough to shorten the fuses of most people.  Add to that the fact that Brisbane (like much of Australia) is in drought, and that the dam levels are dropping to alarmingly low levels.
  • Then there’s the censorship debate that’s been raging on for the past fortnight on both gentoo-dev and gentoo-core.

Some of these problems are aggrivated by communications issues stemming from my Asperger’s Syndrome.  Stress is not something I handle well, with depression being quite common in such circumstances.  I’m in the happy position that I haven’t needed any medication to keep things under control however — I intend to keep things that way if I can.  Right now, I’ve just detected abnormalities in my behaviour, and thus know something is up.
At this point, I’m certainly not planning on resigning from Gentoo.  My builds for MIPS1 (little endian) are progressing, having just started Stage 2 this evening.  There’s no major issues to deal with at this time, and I hope to have these out soon.  I’ve also picked a fight with µClibc trying to bash out updated stages — managed to mess something up rather badly there, but I’ll hopefully get that straightened out and have some netboot images for you.

Presently, I’ve got stuff in my personal life that needs my attention first.  Thus, I’ll be “away” for the next fortnight whilst things settle down locally.  I’ll be contactable by email, and may be on IRC sporadically — but I don’t expect to be doing a hell of a lot.  I need some time to reduce some of the external pressure, get myself mentally ontrack again.  Hopefully when I return, not only will things have calmed down around here, but people within Gentoo, and perhaps others globally, might have settled down too.

In short, I’ll be around, just laying low for a while.

Gentoo/MIPS 2007.0 for Cobalt: Ripe for the picking

Hi All,

I’ve just uploaded the stage 3 tarball for Cobalt users. This build is compiled for MIPS4… hopefully in a few days ~ a week, a MIPS1 build will join it. I’d greatly appreciate it if users could test these builds out and report back any findings.

Also, in case you missed… there’s a new CoLo release. I’ve tested it both booting from disk, as well as netbooting, and so far, everything seems to work as it should… but I’d again appreciate feedback before I bump it to stable. I aim to do this very soon, as the presently stable version does not compile under gcc-4.1.

Hopefully, I should have all this on mirrors by the end of the month once testing has been completed.

Alcatel-Lucent sue over MP3 Patent Infringement

A federal jury in San Diego has ordered Microsoft to pay $1.5 billion to Alcatel-Lucent in a patent dispute over MP3 audio technology used in Windows.

In its verdict, the jury assessed damages based on each Windows PC sold since May 2003. The case could have broader implications, should Alcatel-Lucent pursue claims against other companies that use the widespread MP3 technology.

— http://news.zdnet.com/2100-3513_22-6161480.html

Ouch… See Microsoft?  This is why we use Vorbis. 🙂

The puzzle that is hardware support

Hi All…

Some of you may recall a proposed patch to block the use of proprietary kernel modules in the Linux kernel.  This seemed like a good idea, and it’s one I’d support — however, I do realise there are some shortcomings in the plan.  Looking at the thread tonight, I happened to see a post by David Schwartz which suggested a trademark that could be used by the manufacturer if decent specifications were made available.

I did some thinking about this… and the idea of a small (perhaps non-profit) organisation, could be appointed, to devise Linux-compatibility standards, which companies must meet before they can claim their device is “Linux-Friendly”.  If this organisation agreed that, indeed, the device met the specs, the manufacturer would be given a license to use an appropriate logo when advertising their device to consumers, and they’d be allowed to call their device “Linux-Friendly”.  Otherwise, they’d be told how they can rectify the situation.

I’m thinking something like a 3-level system, which indicates the level of support provided by a device for Linux: (The following is obviously a rough draft)
Bronze-Level Compatibility:

  1. Complete Hardware specifications must be made available to those implementing open-source device drivers
  2. Technical people responsible must be willing to answer questions relating to the implementation of such drivers
  3. Drivers and utilities for the device must be released under the GNU General Public License (may be dual-licensed) and should allow a user to utilise all the device’s features.

Silver-Level Compatibility:

In addition to the requirements of Bronze level, a manufacturer must offer technical support (at minimum, by email) for users running Linux.  Such support should apply to the mainstream Linux distributions (Red Hat/Fedora/CentOS, SuSE, Debian, Gentoo, Ubuntu), but may include other distributions too.
Gold-Level Compatibility:

In addition to the requirements for Silver level, a manufacturer must be actively involved in the development of the open-source driver.  Examples would include the Intel PRO/Wireless devices, WACOM tablets, HP printers…etc — all of these companies run open-source projects that develop drivers for their products.

The above is obviously a work-in-progress, and should not be considered official.  I use the Gold/Silver/Bronze system here, because many people are familiar with how it works.  If you’re new to Linux, obviously Silver or Gold level is best, but things may JustWork with Bronze-rated hardware… if you have contact with Linux-savvy people, or are Linux-savvy yourself, then Bronze will suffice.  If you don’t see any rating at all, it’s a matter of buyer-beware.
What would the logo look like?  Well… I’ve got an idea for that too:

Proposed "Linux Friendly" hardware logo… an emperor penguin giving the "thumbs up".

The penguin was hand-traced from a photograph of a King Penguin uploaded to the WikiMedia Commons.  The thought is, perhaps the blue ring there could be coloured to indicate the level of support.  I have a SVG version of that image here.  Note: I ask people, to not use this logo for commercial use until proper guidelines are worked out.
Anyways… what are people’s thoughts?  I personally think it’ll make life easier for the typical Linux user, in determining what hardware to buy.  If there’s support for the concept, then it encourages through peer pressure, companies to participate, hopefully leading to better quality drivers.

Idiot Spammers

Hi All…

I normally don’t post privately addressed email, and this especially goes for spam… however, I figured you’d get a kick out of this one. (I’ve broken up some of the long lines here… but otherwise, the email is 100% preserved)

Received: (qmail 9490 invoked from network); 19 Feb 2007 21:18:34 +1000
Received: from dsl217-132-169-145.bb.netvision.net.il (HELO dagdans-05n4xgp) (217.132.169.145)
by www.longlandclan.hopto.org with SMTP; 19 Feb 2007 21:18:34 +1000
Received: from 192.168.0.%RND_DIGIT (203-219-%DIGSTAT2-%STATDIG.%RND_FROM_DOMAIN
[203.219.%DIGSTAT2.%STATDIG]) by mail%SINGSTAT.%RND_FROM_DOMAIN (envelope-from
%FROM_EMAIL) (8.13.6/8.13.6)
with SMTP id %STATWORD for < %TO_EMAIL>; %CURRENT_DATE_TIME
Message-Id: < %RND_DIGIT[10].%STATWORD@mail%SINGSTAT.%RND_FROM_DOMAIN>
From: "%FROM_NAME" < %FROM_EMAIL>
%TO_CC_DEFAULT_HANDLER
Subject: %SUBJECT
Sender: "%FROM_NAME" < %FROM_EMAIL>
Mime-Version: 1.0
Content-Type: text/html
Date: %CURRENT_DATE_TIME

%MESSAGE_BODY

Yeah… I don’t think I need to add anything to that. 😉

Gentoo/MIPS 2007.0: Build in full swing

Hi All…

Well, my stagebuilds are in full swing… at this rate, I hope to have stage1 up in a day or two, and I’ll be starting on stage2, etc very soon.
New Profiles:

The structure is much the same as the 2006.1 release, just replace “2006.1” with “2007.0” in your profile path. Portage will tell you what to do when we officially mark the profiles deprecated.  Or, you can switch ahead of time… e.g. on Cobalt:

# rm /etc/make.profile
# ln -sv /usr/portage/profiles/default-linux/mips/2007.0/cobalt/o32 /etc/make.profile

This will set your machine up with the new profile (using LinuxThreads… see below for NPTL).

MIPS1 Stages for Cobalt:

There has been some demand for such stage files for some time now, mainly for enthusiasts that wish to run Gentoo on mipsel machines that don’t implement the full MIPS4 ISA. In this release (after I get the MIPS4 stuff pushed out safely), I’ll build MIPS1 stages for those who wish to experiment. Please Note: We can’t help you with queries involving unsupported systems. For some userland-related issues, we may be able to provide some assistance, but anything involving hardware or kernel, you’re on your own.

The MIPS1 stages are primarily being used in a few unofficial ports of Gentoo to various architectures. I won’t say much more than that, as there are some legal issues which need to be addressed first… however, it is hoped these ports can go ahead. Naturally, I’ll let you know when this happens.

Heads Up – 2007.1 release:

In 2007.1, we plan to switch over to running NPTL across all MIPS platforms. At present, I’m doing some testing on mipsel using NPTL to confirm stability. Other MIPS developers have been running NPTL on SGI boxes for some months now with great success, so the code is considered reasonably stable now, even though it’s not keyworded as such. To use NPTL, switch to the nptl/ profile for your system, unmask glibc-2.4-r4, then upgrade glibc:

e.g. on Cobalt:

# rm /etc/make.profile
# ln -sv /usr/portage/profiles/default-linux/mips/2007.0/cobalt/o32/nptl /etc/make.profile
# echo '=sys-libs/glibc-2.4-r4 ~mips' >> /etc/portage/package.keywords
# emerge -a glibc

It would be greatly appreciated, if a few brave users could give this a try, and report back their findings.

F$#%@ GoBack!!

Yep… it’s another gripe… this time, Symantec’s (really Roxio’s tool) system recovery tool, “GoBack” is in my sights.

For a while, my father has been talking about getting back into using Linux. He recently replaced his dying IBM ThinkPad T22 laptop, with a much more modern LG P1 Express. The machine came pre-loaded with Windows XP, which was fine, we intended to dual-boot. On went the necessities (Firefox, Thunderbird, OpenOffice) and critical utilities like those provided in the Norton SystemWorks suite.

Well, the other day, we decided to actually do it. The machine has a 100GB SATA drive, plenty of space for both operating systems to coexist. We installed Symantec (actually PowerQuest’s product) PartitionMagic, and told Windows to shove over, leaving 40GB for Linux. It wanted to reboot to do the resize, this is fine — we shut down and rebooted as advised.

On the bootup, we get a dreadded blue screen (BSOD-like, but wasn’t a kernel oops) telling us that it can’t resize the partition with GoBack loaded. WTF? They’re both Symantec products?! Surely they should be aware of these limitations? Ahh well, seemingly not, so we reboot again disable GoBack via its bootloader menu, then try again. The resize goes off without a hitch, and we re-enable GoBack, and carry on.

A few days later, we got around to actually installing Linux. We decided on a hand installation of Gentoo Linux/x86 — dispite the laptop being a 64-bit capable Centrino Core Duo machine, we figured 32-bit would be safest for now. I pop in the LiveCD (actually, the 2006.1 prerelease… I never bothered to download a newer CD since this one worked.), and apart from the onboard ethernet card not working (fixed using a USB ethernet dongle), everything installed smoothly.

An oddity I noticed when I ran fdisk… Windows XP is installed on a NTFS partition (one of the reasons why I used PartitionMagic, rather than chancing it with parted). NTFS partitions show up as Type 0x07 (NTFS/HPFS) in fdisk… this partition was showing up as type 0x44 (Unknown), which I thought was bizzare. It was about 60GB in size, and thus I figured it had the NTFS partition inside, so I tacked an Extended partition on the end of that, and inserted my Linux partitions as logical partitions.

Everything was fine… grub installed without a hitch to the master boot record, in a few hours I had the machine booting off the HDD into Linux, talking to the network. Later I got X working (VESA for now… ATI X1400s aren’t supprted yet), and within a day, I had KDE, and all the basics installed.

At this point, I hadn’t tried rebooting into Windows yet … I assumed it was still working. I was badly mistaken. Windows XP would start to load, then flash up a BSOD (a real one), and reboot. Hammering F8, I managed to get it to show me what the BSOD was about… Bloody GoBack2k.sys! It broke normal Windows boot, it broke Safe Mode, and it broke the “last known good configuration”.

Right… so I searched and searched… nothing. Symantec’s website only told me that dual-booting with Linux was not supported: Helpful fellas… might I remind you it’s not your PC, thus I don’t feel it’s your right to tell people what they can run. It was looking like a reinstall, which I was not keen on.

Then I twigged… earlier I had noticed Windows XP’s partition was of type 0x44… what if Windows was looking for a partition of type 0x7? Windows XP is pretty stupid like that — where such a trivial difference would not phase Linux (so long as it had the filesystem drivers for the root), it really breaks Windows badly. The fix was as simple as:

# fdisk /dev/sda
Command (m for help): t
Partition number (1-7): 1
Hex code (type L to list codes): 7
Command (m for help): w

Soon as I did that… Windows XP was happy, I simply booted in, then uninstalled GoBack. The machine is now happily booting both OSes. 🙂

I post this here, for people who find myself in the same ugly situation. For those who are about to install SystemWorks… I recommend you do not install this shoddy piece of software. The rest of SystemWorks does its job rather well IMHO… but I say again, steer clear of GoBack — It Is Broken!