Skip to content

Commit

Permalink
Apply tcp forwarding restrictions to unix sockets too
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj committed Apr 3, 2024
1 parent 1d5f63c commit 796a89e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manpages/dropbear.8
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Enable two-factor authentication. Both password login and public key authenticat
required. Should not be used with the '-s' option.
.TP
.B \-j
Disable local port forwarding.
Disable local port forwarding. This includes unix stream forwards.
.TP
.B \-k
Disable remote port forwarding.
Expand Down Expand Up @@ -136,7 +136,7 @@ Available restrictions are:

.TP
.B no-port-forwarding
Don't allow port forwarding for this connection
Don't allow port forwarding for this connection, including unix streams.

.TP
.B no-agent-forwarding
Expand Down
5 changes: 5 additions & 0 deletions src/svr-tcpfwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ static int newstreamlocal(struct Channel * channel) {

TRACE(("streamlocal channel %d", channel->index))

if (svr_opts.nolocaltcp || !svr_pubkey_allows_tcpfwd()) {
TRACE(("leave newstreamlocal: local unix forwarding disabled"))
goto out;
}

destsocket = buf_getstring(ses.payload, &len);
if (len > MAX_HOST_LEN) {
TRACE(("leave streamlocal: destsocket too long"))
Expand Down

0 comments on commit 796a89e

Please sign in to comment.