adds denied peer ip support in order to prevent XOR-PEER-ADDRESS attacks#222
Closed
nkonev wants to merge 1 commit intopion:masterfrom
Closed
adds denied peer ip support in order to prevent XOR-PEER-ADDRESS attacks#222nkonev wants to merge 1 commit intopion:masterfrom
nkonev wants to merge 1 commit intopion:masterfrom
Conversation
rg0now
added a commit
to l7mp/turn
that referenced
this pull request
Jan 18, 2023
Another attempt to address pion#134, see an earlier attempt in pion#222. pion#222 introduces the DeniedPeerRange stanza into the ServerConfig to implement peer address blacklisting. This approach has a couple of issues: (1) it implements only peer blacklists, but does not allow whiletelisting or filtering based on DNS, etc.;(2) it handles only the ChannelBindRequest codepath, but leaves the CreatePermission codepath (https://datatracker.ietf.org/doc/html/rfc8656#section-3.4) open; and it introduces a new package dependency on "inet.af/netaddr". This patch takes a different approach: it allows the user to specify a PermissionHandler callback for each PacketConnConfig/ListenerConfig in the ServerConfig. Whenever a permission is about to be created via the associated PacketConn/Listener (either via a ChannelBindRequest or a CreatePermission), the PermissionHandler is called with the requested peer address and it can decide whether to accommodate the permission request (return boolean true) or deny it (return false). In the latter case, a "permission request administratively prohibited" error is returned to the client. Also added tests and an example.
rg0now
added a commit
to l7mp/turn
that referenced
this pull request
Jan 18, 2023
Another attempt to address pion#134, see an earlier attempt in pion#222. pion#222 introduces the DeniedPeerRange stanza into the ServerConfig to implement peer address blacklisting. This approach has a couple of issues: (1) it implements only peer blacklists, but does not allow whiletelisting or filtering based on DNS, etc.;(2) it handles only the ChannelBindRequest codepath, but leaves the CreatePermission codepath (https://datatracker.ietf.org/doc/html/rfc8656#section-3.4) open; and it introduces a new package dependency on "inet.af/netaddr". This patch takes a different approach: it allows the user to specify a PermissionHandler callback for each PacketConnConfig/ListenerConfig in the ServerConfig. Whenever a permission is about to be created via the associated PacketConn/Listener (either via a ChannelBindRequest or a CreatePermission), the PermissionHandler is called with the requested peer address and it can decide whether to accommodate the permission request (return boolean true) or deny it (return false). In the latter case, a "permission request administratively prohibited" error is returned to the client. Also added tests and an example.
stv0g
pushed a commit
that referenced
this pull request
Jan 18, 2023
Another attempt to address #134, see an earlier attempt in #222. #222 introduces the DeniedPeerRange stanza into the ServerConfig to implement peer address blacklisting. This approach has a couple of issues: (1) it implements only peer blacklists, but does not allow whiletelisting or filtering based on DNS, etc.;(2) it handles only the ChannelBindRequest codepath, but leaves the CreatePermission codepath (https://datatracker.ietf.org/doc/html/rfc8656#section-3.4) open; and it introduces a new package dependency on "inet.af/netaddr". This patch takes a different approach: it allows the user to specify a PermissionHandler callback for each PacketConnConfig/ListenerConfig in the ServerConfig. Whenever a permission is about to be created via the associated PacketConn/Listener (either via a ChannelBindRequest or a CreatePermission), the PermissionHandler is called with the requested peer address and it can decide whether to accommodate the permission request (return boolean true) or deny it (return false). In the latter case, a "permission request administratively prohibited" error is returned to the client. Also added tests and an example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses #134