Security: Buffer overflow in Brotli decompression
- Fixed in under an hour
- Paid in 11 days
- Disclosed after under an hour
Created attachment 8717115
crash.compressed
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36
Steps to reproduce:
Using AFL, I discovered a pointer underflow bug in brotli decompression that leads to a buffer overflow on the heap.
Reproduction steps:
git clone https://github.com/google/brotli.git
cd brotli
git checkout d4f0cb98411491ade114158f363d8693e89ab473
cd tools
make -j
setarch x86_64 -R ./bro --decompress --input crash.compressed > /dev/null
Two notes:
1. ASLR can be disabled (with setarch) to reproduce reliably. This is because pointer underflow occurs when the ringbuffer has a low-enough address space.
2. git checkout because the trunk of brotli has already been patched by the Google team. Alternatively, use Firefox's dec/ folder when making the binary to reproduce using code in Firefox's trunk.
This was introduced in Aug 2015 to brotli trunk: https://github.com/google/brotli/commit/94cd7085f79a707f5ba3d93086796e695b495975. Firefox trunk (and possibly other versions) contain the vulnerable version of the brotli source code.
I have already submitted this report to Chrome, who informed me that I can report this to you guys as well. The brotli team patched this in their trunk: https://github.com/google/brotli/commit/33aa40220b96cf95ad2b9ba61dc8d7fd2f964f2c and additionally cherry-picked this patch into Chrome 48, 49, and Chromium. Here is an example of one of their patchsets: https://codereview.chromium.org/1672793002
Actual results:
Segmentation fault due to heap buffer overflow
Expected results:
No segmentation fault
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity memory corruption bug in Networking: HTTP. Mozilla made it public on 8 February 2016 as CVE-2016-1968.
About Memory corruption
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.