Querying / testing client-principal:primary-passphrase

Posted by frank.meulblok on 06-Jun-2019 15:22

I've discovered an uindocumented, but somewhat desirable behavior.

The client-principal:primary-passphrase attribute is normally write-only. Meaning you can pass in a password and it stays secret from that point on. Trying to query the attribute will fail, as documented. So far so good.

But there is one exception where the attribute can be queried: when you're inside an Authentication Callback's AuthenticateUser procedure:

The current behavior does allow you to validate the passphrase no matter how it's stored, which is a good thing if for whatever reason you have your own user tables instead of relying on _user.

I assume the current behavior is expected, as it does support the "Design and implement a user-defined authentication system that is enabled for OpenEdge-performed user authentication" use case for using authentication callbacks ? 

(Although, I would have preferred to see a test-passphrase() method instead of being able to query the attribute directly.

As-is, you can and need to expose the client's secret to confirm it matches the secret known by the authentication service. Which gives a way to hijack the client's secret. Using a method to test the match would allow the C-P to confirm a match without exposing the client's secret, as well as making sure that secret is kept in a hashed/encrypted form.)

All Replies

Posted by gus bjorklund on 06-Jun-2019 16:30

> On Jun 6, 2019, at 11:25 AM, frank.meulblok wrote:

>

> As-is, you can and need to expose the client's secret to confirm it matches the secret known by the authentication service. Which gives a way to hijack the client's secret. Using a method to test the match would allow the C-P to confirm a match without exposing the client's secret, as well as making sure that secret is kept in a hashed/encrypted form.)

>

>

>

the clear-text passphrase should not be stored anyplace. instead a (slow) hash of it should be stored.

to validate you hash the passed in passphrase and if the hashes match, it is good.

Posted by frank.meulblok on 07-Jun-2019 09:45

That is true, but you still want to minimize the exposure the hashes get as well.

After all, if you can get the hash values, you can use them as targets for a collision attack or preimage attack.

This thread is closed