Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0.0 include identity by default #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bgrosse-midokura
Copy link
Contributor

  • include identity in computation by default
  • nimbus test overrides routines to exclude identity
  • improved documentation in README.md

fixes #87

@bufistov please share your thoughts :)

* include identity in computation by default
* nimbus test overrides routines to exclude identity
* improved documentation in README.md

fixes #87
README.md Show resolved Hide resolved
## Notes
## Identity and Nimbus implementation

This package's default configuration matches SRP6a: the identity is included in the verifier generation. This makes it impossible to detect if [two users share the same password](https://crypto.stackexchange.com/questions/8626/why-is-tls-srp-verifier-based-on-user-name/9430#9430) but also does not allow a client to change its "identity" without regenerating password.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there more vulnerabilities because of that or this is the only known one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the only known problem.

README.md Show resolved Hide resolved
}
public async computeClientEvidence(
_I: string,
_s: bigint,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

public async computeIdentityHash(_: string, P: string): Promise<ArrayBuffer> {
return await this.hash(stringToArrayBuffer(P));
public async computeIdentityHash(I: string, P: string): Promise<ArrayBuffer> {
return await this.hash(stringToArrayBuffer(I), stringToArrayBuffer(P));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFC adds ':' between identity and password, I think:

SHA1(I | ":" | P)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let's follow that

A: bigint,
B: bigint,
S: bigint,
): Promise<bigint> {
return arrayBufferToBigInt(
await this.hash(
stringToArrayBuffer(I),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHy is this needed? I think RFC only says hash A and B values for evidence. Notice that we can use any known to both client and server values here without impacting anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know, so I will change it back.

@bufistov
Copy link

Looks good to me. I personally like better version without identity in the verifier and I think recreate rfc is just one line change as last line of README points out :)

What shall I read to get really scared about this?

@jbis9051
Copy link
Contributor

If we decide to implement this, considering it will break all implementations of the default library, we should probably provide a note about how to make it compatible with v3.0 in the README.md.

Also I am concerned about how this would effect implementers of this library. Say I have a database of salts and verifiers. I see there is an update for this library related to security, so I decide to update and now none of my users can login. So now I have three non optimal options

  1. Force all users to reset their passwords creating a new salt and verifier
  2. Use the compatibility option
  3. Attempt to slowly transition to v4.0 verifiers by adding a db entry for version and redoing registration if the verifier is v3.0 when any user logs in. This is a major hassle.

Maybe we should check how other SRP implementations (cross language) deal with this. Do they include the identity?

@bufistov
Copy link

Hey, Josh, I don't see major issues with upgrade. I hope you never change version of dependency and rely on users to detect some issues :) To be backward compatible we just need to redefine verifier routine back to v3.0. This is already well documented in README I think. Does it make sense?

@jbis9051
Copy link
Contributor

@bufistov

I hope you never change version of dependency and rely on users to detect some issues

Not sure what you mean. Users are simply free QA testers! ;)


In seriousness, I think this is a major breaking change and if included should be more clear in the README. Maybe something towards the top: "Versions <4.0 did not include the identity for some operations...See below for how to make it compatible with versions <4.0."

Also I think some of the variables in this section should probably be renamed: https://github.com/midonet/tssrp6a/tree/include_identity#usage

@wise1994
Copy link

hi, first of all thank you for all you do. But we shouldn't stop here forever.

I think "can change the identity" is a bad design. We should assume that a well-designed system should not use things like the user's email as the identifier. Just imagine, currently my website uses user email as id, one day in the future I need to add phone number login option, I need to use another id to associate them. Likewise, if I need to provide users with a publicly accessible home page, like Twitter, I need to expose the user's private data in a URL, like this: mysite.com/user_email/post_id

In fact, changing the identity requires no less work than changing the verifier.

Going back to the question itself, I think we should release a major version, exporting two classes, one that includes identity in computation by default, and one that doesn't. We can release another major version at some point in the future, replace the old implementation with the new implementation. But I'm not sure if this is a good idea.

React makes breaking changes in a similar way. Here is one of the examples:

// version < 16
type FC<P = {}> = P & {
  children: ReactNode
}

// version 16 - 18
type FC<P = {}> = P & {
  children: ReactNode
}
type VFC<P = {}> = P & {
  children?: never
}

// version >= 18
type FC<P = {}> = P
// VFC has been removed.

@dmitry-midokura
Copy link

hi, first of all thank you for all you do. But we shouldn't stop here forever.

I think "can change the identity" is a bad design. We should assume that a well-designed system should not use things like the user's email as the identifier. Just imagine, currently my website uses user email as id, one day in the future I need to add phone number login option, I need to use another id to associate them. Likewise, if I need to provide users with a publicly accessible home page, like Twitter, I need to expose the user's private data in a URL, like this: mysite.com/user_email/post_id

In fact, changing the identity requires no less work than changing the verifier.

Going back to the question itself, I think we should release a major version, exporting two classes, one that includes identity in computation by default, and one that doesn't. We can release another major version at some point in the future, replace the old implementation with the new implementation. But I'm not sure if this is a good idea.

React makes breaking changes in a similar way. Here is one of the examples:

// version < 16
type FC<P = {}> = P & {
  children: ReactNode
}

// version 16 - 18
type FC<P = {}> = P & {
  children: ReactNode
}
type VFC<P = {}> = P & {
  children?: never
}

// version >= 18
type FC<P = {}> = P
// VFC has been removed.

Hi @wise1994 , thanks for the input!
I like the idea of having strict SRP6a implementation as part of the library. Will try to find some time to add it, also please feel free to contribute :) I don't think it should be new major version, 3.1.0 would be enough. Does it make sense?

I think that the issue 'user-id =~ e-mail' is ortogonal to the issue 'cannot change username preserving password'. Does it make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why Idenity is not used during verifier calculation?
5 participants