Skip to content
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

Update subscribed accounts when connected site authorizations are modified #1412

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

F-OBrien
Copy link
Contributor

Addresses #1411

@F-OBrien
Copy link
Contributor Author

I you want a UI for testing that uses subscribed accounts you can use https://portal.polymesh.live/ (Polymesh Portal - Testnet)

@TarikGul
Copy link
Member

Thanks for the PR on the queue to review tomorrow!

@F-OBrien
Copy link
Contributor Author

Side note (this might be a bug?) I did not see any restriction in the signing flow for authorized accounts for a specific URL. Authorized accounts are only checked/filtered out when querying or subscribing to accounts. As a result as long as a key is in the keyring any authorized site can trigger the extension to prompt for signing with it. It just might not have an easy way to know it's in the keyring. I noticed this when I removed an authorization for a key with the current extension release 0.49.1 but was still able to sign with it.

I didn't include it in this PR as I'd be concerned any changes to the signing flow could be breaking for downstream consumers of these packages.

Copy link
Member

@bee344 bee344 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on my side, thanks. A note is that the renaming will break stuff downstream, so we need to mention it in the next release's notes.

@@ -271,7 +284,7 @@ export default class State {
};
};

public udateCurrentTabsUrl (urls: string[]) {
public updateCurrentTabsUrl (urls: string[]) {
Copy link
Member

@TarikGul TarikGul Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more specific to @bee344 mention above: When we release this - this specific name change in the api should be mentioned as a BREAKING CHANGE - it's quite minor but nonetheless will be nice to have in the CHANGELOG and release message. I do like this though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should preserve the original method and just mark it as deprecated and add the new one with the fixed name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reintroduced udateCurrentTabsUrl and marked as deprecated.

@TarikGul
Copy link
Member

Side note (this might be a bug?) I did not see any restriction in the signing flow for authorized accounts for a specific URL. Authorized accounts are only checked/filtered out when querying or subscribing to accounts. As a result as long as a key is in the keyring any authorized site can trigger the extension to prompt for signing with it. It just might not have an easy way to know it's in the keyring. I noticed this when I removed an authorization for a key with the current extension release 0.49.1 but was still able to sign with it.

@bee344 @ryanleecode @IkerAlus Can you guys help look into this - I think it would important to get some second eyes and clarity on this. :)

@Tbaut
Copy link
Contributor

Tbaut commented Jul 28, 2024

As a result as long as a key is in the keyring any authorized site can trigger the extension to prompt for signing with it.

The idea about the authorization is to make sure 1) a user actually agrees to share their accounts and 2) they can choose which accounts they share (released recently). What you describe certainly sounds like a check that has been forgotten, as I don't see why we should accept signing request for non-shared account. Regarding the gravity, I wonder how it could be exploited though, as in, a website should trigger many signing requests, with many different accounts, to try to guess what account is present in the keyring.

TL;DR: it should be fixed, but it's not a huge issue unless I missed something

@bee344 bee344 merged commit aa5d99b into polkadot-js:master Jul 29, 2024
3 checks passed
@TarikGul
Copy link
Member

As a result as long as a key is in the keyring any authorized site can trigger the extension to prompt for signing with it.

The idea about the authorization is to make sure 1) a user actually agrees to share their accounts and 2) they can choose which accounts they share (released recently). What you describe certainly sounds like a check that has been forgotten, as I don't see why we should accept signing request for non-shared account. Regarding the gravity, I wonder how it could be exploited though, as in, a website should trigger many signing requests, with many different accounts, to try to guess what account is present in the keyring.

TL;DR: it should be fixed, but it's not a huge issue unless I missed something

I'll follow up on this by filing an issue today - and then we can tackle this eventually - and make it a bit more tolerant.

@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants