Skip to content

Commit

Permalink
ui: reject extended clipboard message if not activated
Browse files Browse the repository at this point in the history
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>
Message-Id: <20240115095119.654271-1-berrange@redhat.com>
  • Loading branch information
berrange authored and elmarco committed Feb 16, 2024
1 parent 3ff11e4 commit 4cba838
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/vnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 4cba838

Please sign in to comment.