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

addPeer subverts whitelist #49

Open
bplaster opened this issue Jul 11, 2018 · 0 comments
Open

addPeer subverts whitelist #49

bplaster opened this issue Jul 11, 2018 · 0 comments

Comments

@bplaster
Copy link

Ideal Behavior:
Prior to connecting, a peer would validate that the remote is on their whitelist.

Actual Behvaior:
If remote peer calls addPeer, they can subvert the client's whitelist.

Example: Peer A creates a swarm with only Peer B on the whitelist. If Peer C calls addPeer(A), then A will allow the connection, even though they have not whitelisted Peer C.

const swarm = require('discovery-swarm')

// On Peer A's computer with IP 192.168.128.100
const opts = {
        whitelist: ['192.168.128.200'] // Peer B
    }
const sw = swarm(opts)
sw.listen(19000)

// On Peer C's computer with IP IP 192.168.128.50
const sw = swarm()
sw.addPeer('arbitraryName', {host: '192.168.128.100', port: '19000'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant