0013-Properly-check-authorization-on-incoming-guestOps-re.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From bb9f9ffbb151397545f921cee5b6a4933c6eea80 Mon Sep 17 00:00:00 2001
  2. Message-Id: <bb9f9ffbb151397545f921cee5b6a4933c6eea80.1666169374.git.stefan@agner.ch>
  3. From: John Wolfe <jwolfe@vmware.com>
  4. Date: Wed, 10 Aug 2022 06:12:02 -0700
  5. Subject: [PATCH] Properly check authorization on incoming guestOps requests
  6. Fix public pipe request checks. Only a SessionRequest type should
  7. be accepted on the public pipe.
  8. Upstream: https://github.com/vmware/open-vm-tools/blob/CVE-2022-31676.patch/1205-Properly-check-authorization-on-incoming-guestOps-re.patch
  9. Signed-off-by: Stefan Agner <stefan@agner.ch>
  10. ---
  11. vgauth/serviceImpl/proto.c | 6 +++++-
  12. 1 file changed, 5 insertions(+), 1 deletion(-)
  13. diff --git a/vgauth/serviceImpl/proto.c b/vgauth/serviceImpl/proto.c
  14. index db7159ee..c4f85b02 100644
  15. --- a/vgauth/serviceImpl/proto.c
  16. +++ b/vgauth/serviceImpl/proto.c
  17. @@ -1,5 +1,5 @@
  18. /*********************************************************
  19. - * Copyright (C) 2011-2016,2019-2021 VMware, Inc. All rights reserved.
  20. + * Copyright (c) 2011-2016,2019-2022 VMware, Inc. All rights reserved.
  21. *
  22. * This program is free software; you can redistribute it and/or modify it
  23. * under the terms of the GNU Lesser General Public License as published
  24. @@ -1201,6 +1201,10 @@ Proto_SecurityCheckRequest(ServiceConnection *conn,
  25. VGAuthError err;
  26. gboolean isSecure = ServiceNetworkIsConnectionPrivateSuperUser(conn);
  27. + if (conn->isPublic && req->reqType != PROTO_REQUEST_SESSION_REQ) {
  28. + return VGAUTH_E_PERMISSION_DENIED;
  29. + }
  30. +
  31. switch (req->reqType) {
  32. /*
  33. * This comes over the public connection; alwsys let it through.
  34. --
  35. 2.38.0