Skip to content

Commit

Permalink
qrexec-daemon: Do not check service identifier for DEFAULT: keyword
Browse files Browse the repository at this point in the history
Service identifiers are not allowed to contain ":", so this cannot be
triggered by a malicious VM, and the subsequent code is secure against
malicious input, so it would be harmless even if it _could_ be
triggered.  Nevertheless, it is cleaner to not do the check.
  • Loading branch information
DemiMarie committed Apr 28, 2024
1 parent e98ed7a commit 4f1e524
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daemon/qrexec-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,9 @@ static int handle_cmdline_body_from_client(int fd, struct msg_header *hdr)
}
}

if (!strncmp(buf, default_user_keyword, default_user_keyword_len_without_colon+1)) {
if ((hdr->type != MSG_SERVICE_CONNECT) &&
(strncmp(buf, default_user_keyword, default_user_keyword_len_without_colon+1) == 0))
{
use_default_user = 1;
hdr->len -= default_user_keyword_len_without_colon;
hdr->len += strlen(default_user);
Expand Down

0 comments on commit 4f1e524

Please sign in to comment.