arbe

turing-complete cretin

Short for Argon Beryllium.

I program and occasionally make 3D art.

My autism didn't come with any superpowers, I want a refund.


personal site
arbe.neocities.org/

NireBryce
@NireBryce

This gives the current destination page JBIG2Bitmap an unknown, but very large, value for h. Since that h value is used for bounds checking and is supposed to reflect the allocated size of the page backing buffer, this has the effect of "unbounding" the drawing canvas. This means that subsequent JBIG2 segment commands can read and write memory outside of the original bounds of the page backing buffer. The heap groom also places the current page's backing buffer just below the undersized syms buffer, such that when the page JBIG2Bitmap is unbounded, it's able to read and write its own fields:

By rendering 4-byte bitmaps at the correct canvas coordinates they can write to all the fields of the page JBIG2Bitmap and by carefully choosing new values for w, h and line, they can write to arbitrary offsets from the page backing buffer. At this point it would also be possible to write to arbitrary absolute memory addresses if you knew their offsets from the page backing buffer. But how to compute those offsets?

As mentioned earlier, the sequence of steps which implement JBIG2 refinement are very flexible. [...] By carefully crafting the context-dependent part of the refinement decompression, it's possible to craft sequences of segments where only the refinement combination operators have any effect. In practice this means it is possible to apply the AND, OR, XOR and XNOR logical operators between memory regions at arbitrary offsets from the current page's JBIG2Bitmap backing buffer. And since that has been unbounded… it's possible to perform those logical operations on memory at arbitrary out-of-bounds offsets:

It's when you take this to its most extreme form that things start to get really interesting. What if rather than operating on glyph-sized sub-rectangles you instead operated on single bits? You can now provide as input a sequence of JBIG2 segment commands which implement a sequence of logical bit operations to apply to the page. And since the page buffer has been unbounded those bit operations can operate on arbitrary memory.

With a bit of back-of-the-envelope scribbling you can convince yourself that with just the available AND, OR, XOR and XNOR logical operators you can in fact compute any computable function - the simplest proof being that you can create a logical NOT operator by XORing with 1 and then putting an AND gate in front of that to form a NAND gate. A NAND gate is an example of a universal logic gate; one from which all other gates can be built and from which a circuit can be built to compute any computable function.

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.



hikari-no-yume
@hikari-no-yume

okay so, i finally found the DOS FPS game i'd played the demo of as a kid!!! i could remember it being in 3D, with configurable sound card options, a kind of sci-fi æsthetic, some outdoor sections with brown being the predominant colour, but also prominant use of electric blue...

based on those details i knew it had to be from the mid-to-late 90's. sure enough, it's Domination (1998), apparently also known Rex Blade: The Battle Begins.

screenshot of Domination (1998) running in DOSBox. a typical 2.5D scene from that era of DOS gaming: grainy pixelly textures, straight walls and floors, a gun rendered as a sprite

playing it now, i understand why I didn't keep playing: it sucks.

the reason i was reminded of it and wanted to find it again today is that i remembered the sound card options, and wondered if it had General MIDI i could try out with my new (old) MIDI module. sure enough, it has both FM synthesis and MIDI, and both OSTs suck. lmao.

BUT.