Page MenuHomePhabricator

[keyserver] Add `isValidSIWENonce` check to `landingResponder`
ClosedPublic

Authored by atul on Dec 23 2022, 6:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 3, 7:52 AM
Unknown Object (File)
Sat, Jun 29, 10:16 PM
Unknown Object (File)
Sat, Jun 29, 5:49 PM
Unknown Object (File)
Tue, Jun 25, 1:50 AM
Unknown Object (File)
Fri, Jun 21, 9:03 PM
Unknown Object (File)
Thu, Jun 6, 10:46 AM
Unknown Object (File)
May 30 2024, 8:05 PM
Unknown Object (File)
May 26 2024, 8:44 AM
Subscribers
None

Details

Summary

Addresses feedback from: https://phab.comm.dev/D5977#180158

If the siweNonce header is set and it's not valid, we immediately return a 400 and return.

If the siweNonce header is empty or it is set and valid, we proceed with the request as usual.

Test Plan
  1. Tested isValidSIWENonce regex with some simple unit tests.
  2. Made sure landing generally continues to work as expected on desktop (no nonce).
  3. Made sure landing/SIWE continues to work as expected on native.
  4. Messed up the nonce in the request to landing/SIWE (hardcoded to some gibberish) and ensured that we got a 400 in response:

Simulator Screen Shot - iPhone 14 Pro - 2022-12-23 at 18.11.14.png (2×1 px, 420 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable