-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
lib/discover: Don't leak relay-tokens to discovery #8762
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
Conversation
The question in my mind is whether/why we want to pass on any query parameters whatsoever to discovery... |
As I understand the current logic, we do submit the query part of the relay server URL because it contains the relay server ID. ST clients wanting to dial another device via a relay address want to open a relay session in temporary mode. In order to perform relay server certificate validation, they need to know the ID. They can get that via the announced URL as part of the query. |
Good point, so that needs to be sent. But currently we just send the full URL as we got it from the relay pool endpoint (or manual config), which contains all kinds of stuff like who provides it etc. |
So we perhaps want to invert the logic (block vs allowlist)? Only include query parameters we explicitly want announced to discovery (the ID) and ignore everything else? |
Use a whitelist of allowed relay address parameters instead of filtering out the token
Something like this? I think the checks failing has nothing to do with the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good - thanks for updating it!
Just one naming suggestion - already approved though.
And yes, the check is definitely not on this PR - probably some FS/OS limitation of the github actions runner (those jobs are new-ish - nice btw :) ). |
* main: (46 commits) build: Update dependencies lib/api: Expose `blocksHash` in file info (syncthing#8810) gui, man, authors: Update docs, translations, and contributors lib/discover: Don't leak relay-tokens to discovery (syncthing#8762) gui, man, authors: Update docs, translations, and contributors gui: Add Croatian (hr) translation template (syncthing#8801) build(deps): bump github.com/quic-go/quic-go from 0.32.0 to 0.33.0 (syncthing#8800) cmd/stupgrades: Cache should apply to HEAD as well as GET build: Add more GitHub Actions gui: Remove non-existent customicons.css file reference (fixes syncthing#8797) (syncthing#8798) Only fail after chmod error if permissions differ (e.g. on config file) (syncthing#8771) gui, man, authors: Update docs, translations, and contributors build: Use Go 1.19.6 for Windows build: Update dependencies gui, man, authors: Update docs, translations, and contributors gui: Remove duplicate Spanish (Spain) translation (fixes syncthing#8781) (syncthing#8782) gui: Add xattr filter editor (fixes syncthing#8660) (syncthing#8734) gui: Switch to Weblate for translations (syncthing#8777) all: Use new Go 1.19 atomic types (syncthing#8772) gui, man, authors: Update docs, translations, and contributors ...
* main: (424 commits) gui, man, authors: Update docs, translations, and contributors lib/protocol: Cache expensive key operations (fixes syncthing#8599) (syncthing#8820) gui: Add Persian (fa) translation template (syncthing#8822) lib: Correctly handle encrypted trailer size (fixes syncthing#8556) (syncthing#8563) gui: Disable Restore Versions filters when no versioned files exist (fixes syncthing#5408) (syncthing#8539) build(deps): bump github.com/chmduquesne/rollinghash from 0.0.0-20180912150627-a60f8e7142b5 to 4.0.0+incompatible (syncthing#8804) build: Update dependencies (syncthing#8821) lib/api: Expose `blocksHash` in file info (syncthing#8810) gui, man, authors: Update docs, translations, and contributors lib/discover: Don't leak relay-tokens to discovery (syncthing#8762) gui, man, authors: Update docs, translations, and contributors gui: Add Croatian (hr) translation template (syncthing#8801) build(deps): bump github.com/quic-go/quic-go from 0.32.0 to 0.33.0 (syncthing#8800) cmd/stupgrades: Cache should apply to HEAD as well as GET build: Add more GitHub Actions gui: Remove non-existent customicons.css file reference (fixes syncthing#8797) (syncthing#8798) Only fail after chmod error if permissions differ (e.g. on config file) (syncthing#8771) gui, man, authors: Update docs, translations, and contributors build: Use Go 1.19.6 for Windows build: Update dependencies ...
This PR aims to mitigate the token-disclosure described in #8561 (comment) by @GermanCoding: The client leaks the relay-token to discovery by announcing it as part of the
relay://...
-URL.I tested this PR with network local and external clients (read: local and global discovery) but would appreciate it if somebody else could give it a go.