Fix illegal client float
PATCH 1/1 Fix illegal client float
From: Lev Stipakov <[email protected]...>
There is a time frame between allocating peer-id and initializing data channel key, which is performed on receiving push request.
If a "rogue" data channel packet arrives during that time frame from another address and with same peer-id, this would cause client to float to that new address. This is because:
- tls_pre_decrypt() sets buffer length to zero if data channel key has not been initialized, which leads to
- openvpn_decrypt() returns true if buffer length is zero,
which leads to
- process_incoming_link_part1() returns true, which
calls multi_process_float(), which commits float
Note that problem doesn't happen when data channel key is initialized, since in this case openvpn_decrypt() returns false.
Fix illegal float by adding buffer length check before calling multi_process_float().
This should fix Trac #1272.
--- src/openvpn/multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/multi.c +1 -1
@@ -2555,7 +2555,7 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) { -if (floated) +if (floated && c->c2.buf.len >0 ) {multi_process_float (m, m->pending); }
Signature · 1 line
2.17.1
Am 13.04.20 um 17:56 schrieb Lev Stipakov:
Quoted 37 lines
From: Lev Stipakov <[email protected]...>
There is a time frame between allocating peer-id and initializing data channel key, which is performed on receiving push request.
If a "rogue" data channel packet arrives during that time frame from another address and with same peer-id, this would cause client to float to that new address. This is because:
-
tls_pre_decrypt()sets buffer length to zero if data channel key has not been initialized, which leads to-
openvpn_decrypt()returns true if buffer length is zero,
which leads to-
process_incoming_link_part1()returns true, which
callsmulti_process_float(), which commits floatNote that problem doesn't happen when data channel key is initialized, since in this case
openvpn_decrypt()returns false.Fix illegal float by adding buffer length check before calling
multi_process_float().This should fix Trac #1272.
Signed-off-by Lev Stipakov <[email protected]...>--- src/openvpn/multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/openvpn/multi.c +0
-0
src/openvpn/multi.c multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst · line 2561
Quoted 8 lines
src/openvpn/multi.c +1
-1@@ -2555,7 +2555,7 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) { -if (floated) +if (floated && c->c2.buf.len >0 ) {multi_process_float (m, m->pending); }
I think the commit is right but should we add a comment here saying that len >0 is required to have valid decrypted packet?
Arne
PATCH v2 1/1 Fix illegal client float
From: Lev Stipakov <[email protected]...>
There is a time frame between allocating peer-id and initializing data channel key, which is performed on receiving push request.
If a "rogue" data channel packet arrives during that time frame from another address and with same peer-id, this would cause client to float to that new address. This is because:
- tls_pre_decrypt() sets packet length to zero if data channel key has not been initialized, which leads to
- openvpn_decrypt() returns true if packet length is zero,
which leads to
- process_incoming_link_part1() returns true, which
calls multi_process_float(), which commits float
Note that problem doesn't happen when data channel key is initialized, since in this case openvpn_decrypt() returns false.
Fix illegal float by adding buffer length check before calling multi_process_float().
This should fix Trac #1272.
---
v2: add comment explaning why nonzero check needed
src/openvpn/multi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/openvpn/multi.c +2 -1
@@ -2555,7 +2555,8 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) { -if (floated) +/* nonzero length means that we have a valid, decrypted packed */ +if (floated && c->c2.buf.len >0 ) {multi_process_float (m, m->pending); }
Signature · 1 line
2.24.1 (Apple Git-126)
Am 15.04.20 um 09:30 schrieb Lev Stipakov:
Quoted 39 lines
From: Lev Stipakov <[email protected]...>
There is a time frame between allocating peer-id and initializing data channel key, which is performed on receiving push request.
If a "rogue" data channel packet arrives during that time frame from another address and with same peer-id, this would cause client to float to that new address. This is because:
-
tls_pre_decrypt()sets packet length to zero if data channel key has not been initialized, which leads to-
openvpn_decrypt()returns true if packet length is zero,
which leads to-
process_incoming_link_part1()returns true, which
callsmulti_process_float(), which commits floatNote that problem doesn't happen when data channel key is initialized, since in this case
openvpn_decrypt()returns false.Fix illegal float by adding buffer length check before calling
multi_process_float().This should fix Trac #1272.
Signed-off-by Lev Stipakov <[email protected]...>---
v2: add comment explaning why nonzero check neededsrc/openvpn/multi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)src/openvpn/multi.c +0
-0
src/openvpn/multi.c multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst · line 2562
Quoted 9 lines
src/openvpn/multi.c +2
-1@@ -2555,7 +2555,8 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) { -if (floated) +/* nonzero length means that we have a valid, decrypted packed */ +if (floated && c->c2.buf.len >0 ) {multi_process_float (m, m->pending); }
Thanks!
Antonio Quartulli
Acked-byHi,
Quoted 51 lines · Arne Schwabe
Am 15.04.20 um 09:30 schrieb Lev Stipakov:
Quoted 39 lines
From: Lev Stipakov <[email protected]...>
There is a time frame between allocating peer-id and initializing data channel key, which is performed on receiving push request.
If a "rogue" data channel packet arrives during that time frame from another address and with same peer-id, this would cause client to float to that new address. This is because:
-
tls_pre_decrypt()sets packet length to zero if data channel key has not been initialized, which leads to-
openvpn_decrypt()returns true if packet length is zero,
which leads to-
process_incoming_link_part1()returns true, which
callsmulti_process_float(), which commits floatNote that problem doesn't happen when data channel key is initialized, since in this case
openvpn_decrypt()returns false.Fix illegal float by adding buffer length check before calling
multi_process_float().This should fix Trac #1272.
Signed-off-by Lev Stipakov <[email protected]...>---
v2: add comment explaning why nonzero check neededsrc/openvpn/multi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)src/openvpn/multi.c +0
-0src/openvpn/multi.c multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst · line 2562
Quoted 9 lines
src/openvpn/multi.c +2
-1@@ -2555,7 +2555,8 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) { -if (floated) +/* nonzero length means that we have a valid, decrypted packed */ +if (floated && c->c2.buf.len >0 ) {multi_process_float (m, m->pending); }Thanks!
Quoted 1 line
Acked-by Arne Schwabe <[email protected]...>
just went through the entire flow with Lev and David and this all makes a lot of sense now. Couldn't come up with a better fix for this issue.
Signature · 1 line
Antonio Quartulli
[Openvpn-devel] [PATCH applied] Re: Fix illegal client float (CVE-2020-11810)
In reply to Lev StipakovYour patch has been applied to the master and release/2.4 branch (bugfix).
I have amended the commit message to make it more clear what is the risk (DoS against another random user of the same server, but no traffic injection or stealing)
Code change is "obviously correct". Have still given it a t_client run for good measure :-)
commit 37bc691e7d26ea4eb61a8a434ebd7a9ae76225ab (master) commit f7b318f811bb43c0d3aa7f337ec6242ed2c33881 (release/2.4)
Author: Lev Stipakov Date: Wed Apr 15 10:30:17 2020 +0300
Fix illegal client float (CVE-2020-11810)
Signed-off-by: Lev Stipakov <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Acked-by: Arne Schwabe <[email protected]...>
Acked-by: Antonio Quartulli <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg19720.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering