VirtualBox

Ignore:
Timestamp:
Sep 30, 2014 7:15:29 PM (10 years ago)
Author:
vboxsync
Message:

SUP: Allow loading of administrator group owned DLLs in addition to localsystem and trustedinstaller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp

    r52795 r52907  
    145145                            g_TrustedInstallerSid,
    146146/** Local system ID (S-1-5-21). */
    147                             g_LocalSystemSid;
     147                            g_LocalSystemSid,
     148/** Builtin Administrators group alias (S-1-5-32-544). */
     149                            g_AdminsGroupSid;
    148150
    149151
     
    452454     * the plugin loaded once it's installed (WinVerityTrust fails).
    453455     *
    454      * Note! We cannot really allow Builtin\Administrators here it's the default
    455      *       owner of anything an admin user creates. (We must, unforutnately,
    456      *       allow that in system32 though.)
     456     * We'd like to avoid allowing Builtin\Administrators here since it's the
     457     * default owner of anything an admin user creates (at least when elevated).
     458     * Seems windows update or someone ends up installing or modifying system
     459     * DLL ownership to this group, so for system32 and winsxs it's unavoidable.
     460     * And, not surprise, a bunch of products, including AV, firewalls and similar
     461     * ends up with their files installed with this group as owner.  For instance
     462     * if we wish to have NAT continue working, we need to allow this.
     463     *
     464     * Hopefully, we can limit the allowed files to these owners though, so
     465     * we won't be subject to ordinary (non-admin, or not elevated) users
     466     * downloading or be tricked into putting evil DLLs around the place...
    457467     */
    458468    PSID pOwner = uBuf.Rel.Control & SE_SELF_RELATIVE ? &uBuf.abView[uBuf.Rel.Owner] : uBuf.Abs.Owner;
     
    462472    if (RtlEqualSid(pOwner, &g_LocalSystemSid))
    463473        return true;
     474    if (RtlEqualSid(pOwner, &g_AdminsGroupSid))
     475    {
     476        SUP_DPRINTF(("%ls: Owner is administrators group.\n", pwszName));
     477        return true;
     478    }
    464479
    465480    SUP_DPRINTF(("%ls: Owner is not trusted installer (%.*Rhxs)\n",
     
    10821097     * SECURITY_BUILTIN_DOMAIN_RID + DOMAIN_ALIAS_RID_ADMINS (with 4.3.16).
    10831098     */
     1099    /** @todo Since we're now allowing Builtin\Administrators after all, perhaps we
     1100     *        could drop these system32 + winsxs hacks?? */
    10841101    if (   (pNtViRdr->fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER)
    10851102        && !supHardNtViCheckIsOwnedByTrustedInstallerOrSimilar(pNtViRdr->hFile, pwszName))
     
    16911708                *RtlSubAuthoritySid(&g_TrustedInstallerSid, 5) = 2271478464;
    16921709
    1693                 if (NT_SUCCESS(rcNt))
    1694                     rcNt = RtlInitializeSid(&g_LocalSystemSid, &s_NtAuth, 1);
     1710                rcNt = RtlInitializeSid(&g_LocalSystemSid, &s_NtAuth, 1);
    16951711                if (NT_SUCCESS(rcNt))
    16961712                {
    16971713                    *RtlSubAuthoritySid(&g_LocalSystemSid, 0) = SECURITY_LOCAL_SYSTEM_RID;
    1698                     return VINF_SUCCESS;
     1714
     1715                    rcNt = RtlInitializeSid(&g_AdminsGroupSid, &s_NtAuth, 2);
     1716                    if (NT_SUCCESS(rcNt))
     1717                    {
     1718                        *RtlSubAuthoritySid(&g_AdminsGroupSid, 0) = SECURITY_BUILTIN_DOMAIN_RID;
     1719                        *RtlSubAuthoritySid(&g_AdminsGroupSid, 1) = DOMAIN_ALIAS_RID_ADMINS;
     1720                        return VINF_SUCCESS;
     1721                    }
    16991722                }
    17001723            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette