Hiker, software engineer (primarily C++, Java, and Python), Minecraft modder, hunter (of the Hunt Showdown variety), biker, adoptive Akronite, and general doer of assorted things.

  • 0 Posts
  • 6 Comments
Joined 1Y ago
cake
Cake day: Jun 13, 2023

help-circle
rss

I donโ€™t know enough about Lemmyโ€™s JWT design, but some JWT designs donโ€™t store the JWT in a database at all, so the only correct response is to regenerate the secret and kill all the sessions by them failing the validity checks.


No, you said you canโ€™t generate valid tokens within the database. I just told you this is the secret, not the tokens (that is present in the database).



Hmโ€ฆ They couldโ€™ve edited the config or just exit(1) if the credential is the default, but very fair.


Oof, okay well thatโ€™s not how I wouldโ€™ve done it. The JWT secret in the database itself could be a vulnerability (e.g., someone that gains read only access to the database could then use that as a wedge to create any JWT they wanted). Iโ€™m not sure if thatโ€™s actually worth bringing up or not (itโ€™s a bit of an odd case).


JWT secret keys are not in the DB (speaking typically, maybe for Lemmy they are, but that would be very surprising), thatโ€™s typically an environment variable or configuration file sort of thing.

In any case, this isnโ€™t the part thatโ€™s broken, it doesnโ€™t need fixed.