fedora 23
access weakness #25

4

Weakness Breakdown


Definition:

An access weakness occurs when software does not properly implement permissions that could have unintended consequences if exploited by malicious actors. An example of this weakness is when a default username and password are set by the developer but do not get changed by the system administrator.

Warning code(s):

If this call fails, the program could fail to drop heightened privileges.

File Name:

libinvm-cim-1.0.0.1041/src/cimom/wmi/wmiUtilities.cpp

Context:

The highlighted line of code below is the trigger point of this particular Fedora 23 access weakness.

 			}
			else
			{
				COMMON_LOG_ERROR("Error allocating the string");
			}
		}
		else
		{
			COMMON_LOG_ERROR("Error getting the string length");
		}
	}

	return result;
};


/*
* Impersonate
* 
* Purpose: Impersonate the client
*/
HRESULT STDMETHODCALLTYPE Impersonate()
{
	LogEnterExit logging(__FILE__, __FUNCTION__, __LINE__);
	HRESULT hr = CoImpersonateClient();
	if (SUCCEEDED(hr))
	{
		// Check to see if call is at lower than
		// RPC_C_IMP_LEVEL_IMPERSONATE level. If that is the case,
		// the provider will not be able to impersonate
		// the client to access the protected resources.

		DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel();
		if (t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE)
		{
			//	Revert before you perform any operations
			CoRevertToSelf();
			hr = WBEM_E_ACCESS_DENIED;
		}
	}
	return hr;
}

/*
*
* GetCurrentImpersonationLevel
* Description: Get COM impersonation level of caller.
*
*/
DWORD GetCurrentImpersonationLevel() 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.