Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A saved login is offered to any form whose slot has the same type. Database sources share the username and password type with FTP, SMB and WebDAV, and SSH keys sit in both sources and destinations. So someone who may only manage destinations could apply the password of a database source to an FTP form pointing at a host they control. The same worked the other way round for the SSH login of a destination. The login was then sent to that host. (GHSA-w34r-cr9x-9jwf)
Fix
A saved login is now applied to a form, or saved on a connection, only when the caller may change every kind of connection that already signs in with it. Holding
credentials:revealalso passes, since that shows the secret anyway. A login no connection uses yet stays open to whoever may change the kind it is applied to. A saved connection keeps using its own logins as long as its config still has the address it has stored, so operators can still test and edit connections an admin set up with a shared login.Changes
src/lib/auth/saved-login-access.ts:assertMayApplySavedLoginis now async and takes the form (kind, config, saved connection id) plus the login ids. The newassertMayUseSavedLoginslooks up which kinds of connection use the logins and checks the write permission of each. The error names the permissions that would allow it.test-connection,access-check,check-snapshot,test-ssh,browse-location,system/filesystem/remote) pass the form and the connection id to the check.POST /api/adapters) and update (PUT /api/adapters/[id]) check the logins they save.check-snapshotandtest-sshnow readconfigIdfrom the request. The SSH test button and snapshot switch send it from the form.Testing: unit tests added and extended as listed above.
pnpm validatewas not run in this description, so TODO confirm.