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.
If this call fails, the program could fail to drop heightened privileges.
wine/src/wine-3.0.4/dlls/secur32/secur32.c
The highlighted line of code below is the trigger point of this particular Alpine 3.9 access weakness.
thunk_InitializeSecurityContextW;
if (inFnTableA->ImportSecurityContextA)
fnTableW->ImportSecurityContextW =
thunk_ImportSecurityContextW;
if (inFnTableA->AddCredentialsA)
fnTableW->AddCredentialsW =
thunk_AddCredentialsW;
if (inFnTableA->QueryCredentialsAttributesA)
fnTableW->QueryCredentialsAttributesW =
thunk_QueryCredentialsAttributesW;
if (inFnTableA->QueryContextAttributesA)
fnTableW->QueryContextAttributesW =
thunk_QueryContextAttributesW;
if (inFnTableA->SetContextAttributesA)
fnTableW->SetContextAttributesW =
thunk_SetContextAttributesW;
/* this can't be thunked, there's no extra param to know which
* package to forward to */
fnTableW->EnumerateSecurityPackagesW = NULL;
/* functions with no thunks needed */
fnTableW->AcceptSecurityContext = inFnTableA->AcceptSecurityContext;
fnTableW->CompleteAuthToken = inFnTableA->CompleteAuthToken;
fnTableW->DeleteSecurityContext = inFnTableA->DeleteSecurityContext;
fnTableW->ImpersonateSecurityContext =
inFnTableA->ImpersonateSecurityContext;
fnTableW->RevertSecurityContext = inFnTableA->RevertSecurityContext;
fnTableW->MakeSignature = inFnTableA->MakeSignature;
fnTableW->VerifySignature = inFnTableA->VerifySignature;
fnTableW->FreeContextBuffer = inFnTableA->FreeContextBuffer;
fnTableW->QuerySecurityPackageInfoW =
QuerySecurityPackageInfoW;
fnTableW->ExportSecurityContext =
inFnTableA->ExportSecurityContext;
fnTableW->QuerySecurityContextToken =
inFnTableA->QuerySecurityContextToken;
fnTableW->EncryptMessage = inFnTableA->EncryptMessage;
fnTableW->DecryptMessage = inFnTableA->DecryptMessage;
}
}
}
static void _copyPackageInfo(PSecPkgInfoW info, const SecPkgInfoA *inInfoA,
const SecPkgInfoW *inInfoW)
{
if (info && (inInfoA || inInfoW))
{
/* odd, I know, but up until Name and Comment the structures are
* identical
*/
memcpy(info, inInfoW ? inInfoW : (const SecPkgInfoW *)inInfoA, sizeof(*info));