open-vm-tools: Security fix CVE-2022-31676

CVE-2022-31676:
VMware Tools (12.0.0, 11.x.y and 10.x.y) contains a local privilege
escalation vulnerability. A malicious actor with local
non-administrative access to the Guest OS can escalate privileges as a
root user in the virtual machine.

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2022-31676

Patch from:
https://github.com/vmware/open-vm-tools/commit/70a74758bfe0042c27f15ce590fb21a2bc54d745

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Yi Zhao
2022-10-10 15:30:07 +08:00
committed by Armin Kuster
parent 9702cc9ba3
commit 6b7c2efd68
2 changed files with 44 additions and 0 deletions
@@ -0,0 +1,43 @@
From 70a74758bfe0042c27f15ce590fb21a2bc54d745 Mon Sep 17 00:00:00 2001
From: John Wolfe <jwolfe@vmware.com>
Date: Sun, 21 Aug 2022 07:56:49 -0700
Subject: [PATCH] Properly check authorization on incoming guestOps requests.
Fix public pipe request checks. Only a SessionRequest type should
be accepted on the public pipe.
CVE: CVE-2022-31676
Upstream-Status: Backport
[https://github.com/vmware/open-vm-tools/commit/70a74758bfe0042c27f15ce590fb21a2bc54d745]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
open-vm-tools/vgauth/serviceImpl/proto.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/open-vm-tools/vgauth/serviceImpl/proto.c b/open-vm-tools/vgauth/serviceImpl/proto.c
index db7159ee..6c672601 100644
--- a/open-vm-tools/vgauth/serviceImpl/proto.c
+++ b/open-vm-tools/vgauth/serviceImpl/proto.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2011-2016,2019-2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2016,2019-2022 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -1201,6 +1201,10 @@ Proto_SecurityCheckRequest(ServiceConnection *conn,
VGAuthError err;
gboolean isSecure = ServiceNetworkIsConnectionPrivateSuperUser(conn);
+ if (conn->isPublic && req->reqType != PROTO_REQUEST_SESSION_REQ) {
+ return VGAUTH_E_PERMISSION_DENIED;
+ }
+
switch (req->reqType) {
/*
* This comes over the public connection; alwsys let it through.
--
2.25.1
@@ -44,6 +44,7 @@ SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https;branch=maste
file://0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch;patchdir=.. \
file://0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \
file://0001-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \
file://0001-Properly-check-authorization-on-incoming-guestOps-re.patch;patchdir=.. \
"
UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)"