Unbelievable
💡
JBIG2 doesn't have scripting capabilities, but when combined with a vulnerability, it does have the ability to emulate circuits of arbitrary logic gates operating on arbitrary memory. So why not just use that to build your own computer architecture and script that!? That's exactly what this exploit does. Using over 70,000 segment commands defining logical bit operations, they define a small computer architecture with features such as registers and a full 64-bit adder and comparator which they use to search memory and perform arithmetic operations. It's not as fast as Javascript, but it's fundamentally computationally equivalent.
💡
The bootstrapping operations for the sandbox escape exploit are written to run on this logic circuit and the whole thing runs in this weird, emulated environment created out of a single decompression pass through a JBIG2 stream. It's pretty incredible, and at the same time, pretty terrifying.
Whole article how they made it - https://googleprojectzero.blogspot.com
Explanation what they have made - Pegasus_(spyware).
The lesson from the whole article is that there are still programmers who can work without using https://stackoverflow.com!
As we say in my homeland - "the road to hell is paved with good intentions ..."
The result of their briliant work is simply awwful!
Please note another interesting idea, using the same concept - "Open Redstone project" and his description.