-
-
Notifications
You must be signed in to change notification settings - Fork 875
Stop using __version__ for URLs: Use secure version_signature instead
#5432
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
base: main
Are you sure you want to change the base?
Conversation
|
Quick feedback after talking to Rodja:
|
|
Version signature function is cached, so I think it is not wasteful? Still if we want to be more explicit in the constant nature we can move away from a cached function. The part about On Air is fair, but I don't know how to work on it since I don't know about its inner workings... |
|
Well for On Air I don't think a secretive version is possible considering CDN use. Definitely we won't use a separated secret: that way the CDN is incredibly ineffective. Using a shared secret is as good as no secret, because the hash of a particular version can simply be stored in a lookup dictionary somewhere. So for On Air we should rather stick with the original plaintext version. |
On Air is a smart CDN. If the on air connection provides the information which NiceGUI version the app is running plus it's version_signature, the On Air server can use that to serve the right version from CDN if requests are made to that signature. |
2 concerns:
Anyways I think you will need to take charge on anything that has to do with On Air, including security and client<->server interplay. |
Motivation
The security-focused would suggest that version information be kept private.
For example, browsers are freezing the version show in User-Agent-string.
So, being able to list the exact NiceGUI versions used for the websites in #4506, may not be a good idea after all.
Impact-wise it's not that big though. It doesn't even qualify for a security advisory.
Implementation
NiceGUI versions don't have a lot, so hashing that is a no-no (can rainbow table / enumerate)
So, the new
version_signatureis based off the storage secret under HMAC-SHA256 scheme, which is (iirc) exactly how our client-side JWT cookies are signed.So long as the storage secret is private, there is no good way to brute force through all NiceGUI versions, without first brute-forcing the storage secret.
Progress
Fix cyclic import. Need help!Final notes
Script kiddies will spam all exploits, so if you're vulnerable you're doomed anyways.
Security through obscurity is no good. It isn't even security.