]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix possible security issue with the permissions of the intermediate
authorOliver Kurth <okurth@vmware.com>
Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)
staging directory and path

/tmp/VMwareDnD is a staging directory used for DnD and CnP.  It should be
a regular directory, but malicious code or user may create the /tmp/VMwareDnD
as a symbolic link which points elsewhere on the system.  This may provide
user access to user B's files.

Do not set the permission of the root directory if the root directory
already exists and has the wrong permission.  The permission of the directory
must be 1777 if it is created by the VMToolsi.  If not, then the directory
has been created or modified by malicious code or user, so just cancel the
host to guest DnD or CnP operation.

open-vm-tools/services/plugins/dndcp/dnd/dndCommon.c
open-vm-tools/services/plugins/dndcp/dnd/dndXdg.c

index 973d2951990cb999b1c11ec77e24fa1bc1449f99..8b8821f00643871d492603b1fe1bb78a6fafa7a7 100644 (file)
@@ -276,12 +276,11 @@ DnDCreateRootStagingDirectory(void)
    }
 
    if (File_Exists(root)) {
-      if (!DnDRootDirUsable(root) &&
-          !DnDSetPermissionsOnRootDir(root)) {
+      if (!DnDRootDirUsable(root)) {
          /*
-          * The directory already exists and its permissions are wrong and
-          * cannot be set, so there's not much we can do.
+          * The directory already exists and its permissions are wrong.
           */
+         Log("%s: The root dir is not usable.\n", __FUNCTION__);
          return NULL;
       }
    } else {
index 4f52829e70b7c6c9965b9951efc64ba3d0815b14..9a273d645cec46db8f5d2c098f379cbc167ed56d 100644 (file)
@@ -318,12 +318,11 @@ CreateApparentRootDirectory(void)
    }
 
    if (File_Exists(root)) {
-      if (   !DnDRootDirUsable(root)
-          && !DnDSetPermissionsOnRootDir(root)) {
+      if (!DnDRootDirUsable(root)) {
          /*
-          * The directory already exists and its permissions are wrong and
-          * cannot be set, so there's not much we can do.
+          * The directory already exists and its permissions are wrong.
           */
+         Log_Trivia("dnd: The root dir is not usable.\n");
          return NULL;
       }
    } else {