Skip to contentSkip to conversation

ui: reject extended clipboard message if not activated

PATCH In review Daniel P. Berrangé 3 participants 4 messages Jan 15, 2024 – Jan 17, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui: reject extended clipboard message if not activated

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.

---

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(+)
ui/vnc.c +5 -0
index 4f23a0fa79..3b2c71e653 100644
@@ -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.");
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · 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.

Quoted 30 lines

---

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(+)
ui/vnc.c +5 -1
index 4f23a0fa79..3b2c71e653 100644
@@ -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

Signature · 1 line
Marc-André Lureau
#2 lore raw
In reply to Daniel P. Berrangé
Quoted 5 lines · 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.

Quoted 7 lines

---

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

#3 lore raw
Quoted 9 lines · Michael Tokarev
Quoted 8 lines · 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.

---

Quoted 7 lines
Quoted 4 lines

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

Signature · 3 lines
|: 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 :|