haskell-distributed / haskell-distributed/distributed-process

[NTTCP-7] handleConnectionRequest should not blindly believe theirAddress

Open
#439 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

network-transport-tcp
Dominant language
Haskell
Stars
751
Forks
99
Avg merge
45m
Merged PRs (30d)
2

Description

[Imported from JIRA. Reported by Alexander Kjeldaas @ak) as NTTCP-7 on 2014-07-19 23:28:20]
From casually reading the code, I'm worried about believing the received EndPointAddress in handleConnectionRequest.

In an environment where not all processes have the same credentials, this opens up the ability to spoof other processes.

If node A connects to node B and presents itself as node C, then this is a spoofing attempt.

(Not fixing this severely restricts the use-cases for CH).

Rather, I think what should be done is by default to screen the incoming EndPointAddress against Network.Socket.getPeerName and reject anything that does not match.

Bonus points for having a callback that can act as a "firewall" in case the transport is going through a NAT (in which case accepting the EndPointAddress is essential in getting bi-directional connectivity).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading handleConnectionRequest and the surrounding transport code, then inspect how Network.Socket.getPeerName can be used to compare the peer with the received EndPointAddress. Define the default rejection behavior for mismatches and the callback boundary needed for NAT cases. Done means spoofed identities are rejected by default while legitimate NAT connectivity remains configurable.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
distributed-systems, networking, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.