UserNameToken and cleartext passwords

Security Briefs

Syndication

Aaron mentioned a gripe I have with UserNameToken. The approach recommended by the UserNameToken profile, namely the one-time hash that is designed to counter replay attacks,

Password_Digest = Base64 ( SHA-1 ( nonce + created + password ) )

requires that the server store the client's cleartext password if simple passwords are being used - note that the profile also supports password being a one-time key or other secret such as that generated by a SecurID token. But the implementations and frameworks being built today (namely WSE) are taking this quite literally and using cleartext passwords for password by default.

My main gripe with this simple implementation is that if an attack on the server leads to cleartext passwords being recovered, this is catastrophic! Passwords are generally used when humans are involved, and humans generally use the same password wherever they go. It's not a good practice, but it's one that the vast majority of people use today. No security-concious developer wants to be storing secrets on his machine. Especially secrets that in real life will often have a scope beyond her own application!

Given that password in the above function need not be a real cleartext password according to the profile, I see no reason why we cannot simply identify a scope over which a given password will be valid and identify a unique string or URI for that scope (this could be done through policy, perhaps). Then, we can start with

Password_Digest = Base64 ( SHA-1 ( nonce + created + validator ) )

and we can then calculate validator as

validator = Base64 ( SHA-1 ( scopeURI + cleartextPassword ) )

which means the server would only need to store validator, as opposed to the cleartext password itself. If an attack on the server leads to these validators being compromised, the user's cleartext password is still safe. It's a simple idea, and I'd love for someone to explain why this isn't in the profile or implemented in WSE. Perhaps Aaron could comment on whether this notion of a scopeURI would be feasible - I'm sure he knows much more about policy than I do.


Posted Jul 03 2004, 11:14 AM by keith-brown
Filed under: ,

Comments

The XML Files wrote Avoiding Cleartext Passwords
on 07-05-2004 10:42 AM
SecureWebServices.Org wrote WS-Security UserNameToken and cleartext passwords
on 07-06-2004 5:54 AM
Keith Brown makes some interesting points in his blog about WS-Security UserNameToken profile and storing cleartext passwords on the server. In essence, his suggestion is to establish
Geek Noise wrote Geek Notes 2004-07-06
on 07-06-2004 4:13 PM
JosephCooney wrote Interesting WSE2 UsernameToken Authentication Discussion
on 07-13-2004 8:23 AM
Interesting WSE2 UsernameToken Authentication Discussion
TrackBack wrote Mindreef - Jim Murphy's Weblog
on 07-29-2004 4:07 PM
Mindreef - Jim Murphy's Weblog
ScottWater wrote re: WS-Security: What if you are already Hashed?
on 09-04-2004 2:50 PM
Haacked wrote re: UserNameToken and cleartext passwords
on 09-09-2004 12:24 PM
I've written up how I would approach this problem.

http://haacked.com/archive/2004/09/09/1177.aspx

Not sure if there are any unforeseen problems I'm not seeing.
you've been HAACKED wrote WSE 2.0 Authentication: How To Avoid ClearText Passwords With UsernameToken
on 09-09-2004 2:21 PM
you've been HAACKED wrote WSE 2.0 Authentication: How To Avoid ClearText Passwords With UsernameToken
on 09-09-2004 2:51 PM
William wrote re: UserNameToken and cleartext passwords
on 01-15-2005 7:06 AM
Interesting Keith. I am thinking scopeURI effectively becomes a salt, so scopeURI could be anything known at both sides. So may as well do:

Password_Digest = Base64 ( sha1( nonce + created + v )

v = Base64(sha1(password + salt))

salt = Base64(sha1(userName))

That way you don't have a lot of debug issues with what URI should I use, etc. As a bonus, we can do this today. And this would work with both SendPlainText and SendHashed. I blogged a c# implementation at http://spaces.msn.com/members/staceyw

--William
JCooney.NET wrote Interesting WSE2 UsernameToken Authentication Discussion
on 01-31-2005 5:38 AM

Add a Comment

(required)  
(optional)
(required)  
Remember Me?