Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Connecting to running daemon with wrong ID makes daemon start listening on address with wrong ID #737

Closed
victorb opened this issue Jan 29, 2017 · 4 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up

Comments

@victorb
Copy link
Member

victorb commented Jan 29, 2017

I'm running on js-ipfs node in the browser and one daemon in nodejs. If I connect from the browser to the nodejs daemon with ipfs.swarm.connect but the ID part of the multiaddr is wrong, it'll start listening on that address...

Reproduce

  1. Run jsipfs daemon
  2. Run jsipfs id, output:
{
  "id": "QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt",
  "publicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUoAkSt6vtv2ZkC3maLnBGnA1OMNnSW/FsFnfhT+zQMy9A4YkePGigpNQsiI9yKMoeacBqZsNCDIGqebc5FquMLRRPN/GBJZz7tTT3uZo1aVBFcCiQapbGB56SYkxBFIyLFAlzJ3Ee8rGINvl7+iUZBirV9VylQXvGU3IRYe6zQR0Et/J5QjLIF3j5wylEm5SvN8//nGaecd0GwX5dYe3RawMlPIm+vCN+fIy1MpQQyT33IuM1iEEXzRsNzHeZ2GlWMrTQNjmKdFk4G/p/fVxxN45RpW0BDB9Em89JB9NHP2it4meg2Ao/QOfugFjtt4lHYML1KZvX/aqO8db6wN8pAgMBAAE=",
  "addresses": [
    "/ip4/0.0.0.0/tcp/9999/ws/ipfs/QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt",
    "/ip4/127.0.0.1/tcp/4002/ipfs/QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt",
    "/ip4/192.168.1.128/tcp/4002/ipfs/QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt"
  ],
  "agentVersion": "js-ipfs",
  "protocolVersion": "9000"
}
  1. connect from browser node with wrong id:
ipfs.swarm.connect('/ip4/0.0.0.0/tcp/9999/ws/ipfs/QmSGmyZtL3BPLxkF9yyaitLsotvratuqeWq1UR8V9BDXcV')
  1. run jsipfs id again, output:
{
  "id": "QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt",
  "publicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUoAkSt6vtv2ZkC3maLnBGnA1OMNnSW/FsFnfhT+zQMy9A4YkePGigpNQsiI9yKMoeacBqZsNCDIGqebc5FquMLRRPN/GBJZz7tTT3uZo1aVBFcCiQapbGB56SYkxBFIyLFAlzJ3Ee8rGINvl7+iUZBirV9VylQXvGU3IRYe6zQR0Et/J5QjLIF3j5wylEm5SvN8//nGaecd0GwX5dYe3RawMlPIm+vCN+fIy1MpQQyT33IuM1iEEXzRsNzHeZ2GlWMrTQNjmKdFk4G/p/fVxxN45RpW0BDB9Em89JB9NHP2it4meg2Ao/QOfugFjtt4lHYML1KZvX/aqO8db6wN8pAgMBAAE=",
  "addresses": [
    "/ip4/0.0.0.0/tcp/9999/ws/ipfs/QmSGmyZtL3BPLxkF9yyaitLsotvratuqeWq1UR8V9BDXcV",
    "/ip4/0.0.0.0/tcp/9999/ws/ipfs/QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt",
    "/ip4/127.0.0.1/tcp/4002/ipfs/QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt",
    "/ip4/192.168.1.128/tcp/4002/ipfs/QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt"
  ],
  "agentVersion": "js-ipfs",
  "protocolVersion": "9000"
}

Now it's listening on /ip4/0.0.0.0/tcp/9999/ws/ipfs/QmSGmyZtL3BPLxkF9yyaitLsotvratuqeWq1UR8V9BDXcV even though the daemons ID is QmVabaitA7SyHTWgY4Bhtc7JfAzMXWeXqBMT93teDic4nt

@victorb victorb added the kind/bug A bug in existing code (including security flaws) label Jan 29, 2017
@daviddias
Copy link
Member

woa, that is super weird, this seems a thing that can be replicated in a test, can you add it please?

@daviddias daviddias added the status/deferred Conscious decision to pause or backlog label Jan 29, 2017
@daviddias daviddias added exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue status/ready Ready to be worked and removed status/deferred Conscious decision to pause or backlog labels Apr 5, 2017
@daviddias daviddias added status/deferred Conscious decision to pause or backlog and removed status/ready Ready to be worked labels Jun 20, 2017
@daviddias
Copy link
Member

@victorbjelkholm how to reproduce this?

@daviddias daviddias added status/ready Ready to be worked P1 High: Likely tackled by core team if no one steps up and removed status/deferred Conscious decision to pause or backlog labels Oct 17, 2017
@daviddias
Copy link
Member

Is this still a bug?

@daviddias
Copy link
Member

daviddias commented Mar 16, 2018

Can't reproduce. Closing. @victorbjelkholm if you have time to look into it again and find that the error is still here, feel free to reopen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

No branches or pull requests

2 participants