qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui: reject extended clipboard message if not activated
@ 2024-01-15  9:51 Daniel P. Berrangé
  2024-01-15 10:00 ` Marc-André Lureau
  2024-01-17 12:10 ` Michael Tokarev
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2024-01-15  9:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fiona Ebner, Markus Frank, Gerd Hoffmann, Marc-André Lureau,
	Daniel P. Berrangé

The extended clipboard message protocol requires that the client
activate the extension by requesting a psuedo encoding. If this
is not done, then any extended clipboard messages from the client
should be considered invalid and the client dropped.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

The need for fix was identified as part of investigation for
CVE-2023-6683. This does NOT, however, fix that CVE as it only
addresses one of the problem codepaths that can trigger that
CVE.

 ui/vnc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ui/vnc.c b/ui/vnc.c
index 4f23a0fa79..3b2c71e653 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2445,6 +2445,11 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
         }
 
         if (read_s32(data, 4) < 0) {
+            if (!vnc_has_feature(vs, VNC_FEATURE_CLIPBOARD_EXT)) {
+                error_report("vnc: extended clipboard message while disabled");
+                vnc_client_error(vs);
+                break;
+            }
             if (dlen < 4) {
                 error_report("vnc: malformed payload (header less than 4 bytes)"
                              " in extended clipboard pseudo-encoding.");
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ui: reject extended clipboard message if not activated
  2024-01-15  9:51 [PATCH] ui: reject extended clipboard message if not activated Daniel P. Berrangé
@ 2024-01-15 10:00 ` Marc-André Lureau
  2024-01-17 12:10 ` Michael Tokarev
  1 sibling, 0 replies; 4+ messages in thread
From: Marc-André Lureau @ 2024-01-15 10:00 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Fiona Ebner, Markus Frank, Gerd Hoffmann

On Mon, Jan 15, 2024 at 1:52 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> The extended clipboard message protocol requires that the client
> activate the extension by requesting a psuedo encoding. If this
> is not done, then any extended clipboard messages from the client
> should be considered invalid and the client dropped.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>
> The need for fix was identified as part of investigation for
> CVE-2023-6683. This does NOT, however, fix that CVE as it only
> addresses one of the problem codepaths that can trigger that
> CVE.
>
>  ui/vnc.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 4f23a0fa79..3b2c71e653 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -2445,6 +2445,11 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
>          }
>
>          if (read_s32(data, 4) < 0) {
> +            if (!vnc_has_feature(vs, VNC_FEATURE_CLIPBOARD_EXT)) {
> +                error_report("vnc: extended clipboard message while disabled");
> +                vnc_client_error(vs);
> +                break;
> +            }
>              if (dlen < 4) {
>                  error_report("vnc: malformed payload (header less than 4 bytes)"
>                               " in extended clipboard pseudo-encoding.");
> --
> 2.43.0
>
>


-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ui: reject extended clipboard message if not activated
  2024-01-15  9:51 [PATCH] ui: reject extended clipboard message if not activated Daniel P. Berrangé
  2024-01-15 10:00 ` Marc-André Lureau
@ 2024-01-17 12:10 ` Michael Tokarev
  2024-01-17 12:15   ` Daniel P. Berrangé
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2024-01-17 12:10 UTC (permalink / raw)
  To: Daniel P. Berrangé, qemu-devel
  Cc: Fiona Ebner, Markus Frank, Gerd Hoffmann, Marc-André Lureau,
	qemu-stable

15.01.2024 12:51, Daniel P. Berrangé wrote:
> The extended clipboard message protocol requires that the client
> activate the extension by requesting a psuedo encoding. If this
> is not done, then any extended clipboard messages from the client
> should be considered invalid and the client dropped.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> 
> The need for fix was identified as part of investigation for
> CVE-2023-6683. This does NOT, however, fix that CVE as it only
> addresses one of the problem codepaths that can trigger that
> CVE.

This might be a good pick for -stable too, in addition to the actual
CVE-2023-6683 fix (adding -stable).

/mjt


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ui: reject extended clipboard message if not activated
  2024-01-17 12:10 ` Michael Tokarev
@ 2024-01-17 12:15   ` Daniel P. Berrangé
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2024-01-17 12:15 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: qemu-devel, Fiona Ebner, Markus Frank, Gerd Hoffmann,
	Marc-André Lureau, qemu-stable

On Wed, Jan 17, 2024 at 03:10:30PM +0300, Michael Tokarev wrote:
> 15.01.2024 12:51, Daniel P. Berrangé wrote:
> > The extended clipboard message protocol requires that the client
> > activate the extension by requesting a psuedo encoding. If this
> > is not done, then any extended clipboard messages from the client
> > should be considered invalid and the client dropped.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> > 
> > The need for fix was identified as part of investigation for
> > CVE-2023-6683. This does NOT, however, fix that CVE as it only
> > addresses one of the problem codepaths that can trigger that
> > CVE.
> 
> This might be a good pick for -stable too, in addition to the actual
> CVE-2023-6683 fix (adding -stable).

Agreed, both would be a good idea for stable.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-17 12:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15  9:51 [PATCH] ui: reject extended clipboard message if not activated Daniel P. Berrangé
2024-01-15 10:00 ` Marc-André Lureau
2024-01-17 12:10 ` Michael Tokarev
2024-01-17 12:15   ` Daniel P. Berrangé

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).