Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

feat: localize plugin provider to mitigate supply chain attacks #70

Closed
wants to merge 1 commit into from

Conversation

bitpshr
Copy link
Contributor

@bitpshr bitpshr commented Oct 23, 2019

This pull request localizes plugin provider instances within plugins to mitigate the possibility of dependency supply chain attacks. This is done by exposing a new top-level registerPlugin API; this seemed like less of a hack than relying on internal (possibly changing) semantics of immutability within SES.

Note: Once this lands, the following updates should be made:

Resolves #53

@danfinlay
Copy link
Collaborator

I'd like to get an open examples PR open so that we can merge it at the same time as this, to minimize time where we're hosting an incompatible set of tools.

@kumavis
Copy link
Member

kumavis commented Oct 24, 2019

How does this reduce the risk?

@danfinlay
Copy link
Collaborator

@kumavis Per #53, the concern was that injecting a wallet global would expose that (permissioned) global to all of the module's dependencies, making plugins more susceptible to supply chain attacks.

By passing the sensitive/permissioned API as an argument, the plugin has a controlled scope around the variable, and so other dependencies would not have access to it.

Maybe we should have verified the attack first: In your opinion, is a SES container already adequately scoped?

@danfinlay
Copy link
Collaborator

We're now running the experiment:

Can entry index.js require a second module attacker.js that can then access wallet globally?

@danfinlay
Copy link
Collaborator

Closing for now since some questions were raised about the efficacy of this approach.

@danfinlay danfinlay closed this Oct 28, 2019
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.

Pass wallet API in as parameter, not as global
3 participants