wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Chris Branch <cbranch@cloudflare.com>, wireguard@lists.zx2c4.com
Subject: Re: [PATCH] Fix transport message length check
Date: Tue, 25 Sep 2018 05:20:43 +0200	[thread overview]
Message-ID: <af2e1b70-1fd9-01c5-67f0-f039549e6476@zx2c4.com> (raw)
In-Reply-To: <20180920122853.33762-1-cbranch@cloudflare.com>

Hey Chris,

On 9/20/18 2:28 PM, Chris Branch wrote:
> wireguard-go has a bad length check in its transport message handling.
> Although it cannot be exploited because of another length check earlier in the
> function, this should be fixed regardless.
> 
> ---
>   receive.go | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/receive.go b/receive.go
> index 6b6543c..cbc3fd1 100644
> --- a/receive.go
> +++ b/receive.go
> @@ -146,7 +146,7 @@ func (device *Device) RoutineReceiveIncoming(IP int, bind Bind) {
>   
>   			// check size
>   
> -			if len(packet) < MessageTransportType {
> +			if len(packet) < MessageTransportSize {
>   				continue
>   			}
>   
> 


Nice catch! Fixed in master. I'll probably have a new snapshot out not 
before too long.

Jason
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2018-09-25  3:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 12:28 [PATCH] Fix transport message length check Chris Branch
2018-09-25  3:20 ` Jason A. Donenfeld [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af2e1b70-1fd9-01c5-67f0-f039549e6476@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=cbranch@cloudflare.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).