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

User authentication is flawed #2507

Open
ineiti opened this issue Jun 27, 2023 · 0 comments
Open

User authentication is flawed #2507

ineiti opened this issue Jun 27, 2023 · 0 comments
Labels

Comments

@ineiti
Copy link
Member

ineiti commented Jun 27, 2023

The current user authentication is flawed. To authenticate, a user:

  1. logs into Gaspar
  2. gets a signature from the auth-server on their ID and the master chain ID

However:

  • there is no timeout, so anybody could take this signature and just forge any message they want to
  • the messages sent to the service-api are not signed in any way, so the leader can change them at will

Proposed fix for the authentication:

  1. When a user authentifies, they create an ephemeral keypair and send the ephemeral public key to the authentication server
  2. The authentication server checks with Gaspar that the user is who they pretend to be
  3. The authentication server creates a certificate by signing the ephemeral public key, together with a timestamp
  4. This certificate is only valid for a given timeframe (30 minutes? 1 hour?)
  5. Whenever the user wants to call the service-api, they sign the whole message including all the data with their
    ephemeral private key and add the certificate of the authentication server
  6. The backend verifies the validity of the certificate by verifying the signature and the timestamp, then uses the public key in the certificate to verify the message from the user
@ineiti ineiti added the bug label Jun 27, 2023
@ineiti ineiti changed the title EVoting Cast security issue User authentication is flawed Jun 28, 2023
ineiti added a commit that referenced this issue Jun 28, 2023
Added some security bugs found while adding the new functionalities.
They are here: #2507 #2508 #2509 #2510

Also added some comments and fixed some typos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant