Skip to content

fix(iroh-relay): prevent empty datagrams payload from disconnecting recipient - #4646

Open
mattyg wants to merge 1 commit into
n0-computer:mainfrom
mattyg:fix/empty-datagram-close-connection
Open

mattyg wants to merge 1 commit into
n0-computer:mainfrom
mattyg:fix/empty-datagram-close-connection

Conversation

@mattyg

@mattyg mattyg commented Oct 27, 2026 •

Copy link
Copy Markdown

Description

Error when attempting to decode a dataframe containing an empty payload, so it is not passed onto the recipient which would cause them to be disconnected from the relay. Resolution to https://github.com/n0-computer/iroh/security/advisories/GHSA-5c6r-mh39-9998

API Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All API changes documented.

@n0bot n0bot Bot added this to iroh Oct 27, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Oct 27, 2026
@flub flub added the c-iroh-relay Functionality of the iroh-relay server. label Nov 3, 2026

@flub flub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't quite follow this. IIUC this still results in an error being produced from the RelayedStream instead of a frame. And when the relay server receives such a message it's server::client::Actor::handle_frame returns with an error which kills the entire actor. In turn disconnecting the client which sent the empty datagram. Is that the goal here?

I'm a bit hesitant of this solution. Sending empty datagrams is valid to do over IP networks. It's weird, but valid. While nothing in the iroh stack currently relies on being able to send empty datagrams, I feel uneasy about baking it into the relay protocol that you can't send empty datagrams. It is supposed to be a dumb datagram transport and this changes that because now it has non-standard opinions about those datagrams.

So I think I'd prefer to rather make it so that the relay keeps it's ability to pass empty datagrams along and instead make the iroh client side handle an empty datagram gracefully.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-iroh-relay Functionality of the iroh-relay server.

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants