OpenImageIO RLA format rle span out-of-bounds read vulnerability
A heap out-of-bounds read vulnerability exists in the RLA format parser of OpenImageIO when handling run-length encoded byte spans. A malformed RLA file can cause an out-of-bounds read of heap metadata, potentially leaking sensitive information.
Originally disclosed on Cisco Talos
A heap out-of-bounds read vulnerability exists in the RLA format parser of OpenImageIO master-branch-9aeece7a and v2.3.19.0. More specifically, in the way run-length encoded byte spans are handled.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an off-by-one error in the RLE decoding loop: the index is incremented after the bounds check, allowing a read one byte past the end of the encoded buffer.
Impact
This could lead to a sensitive information leak of heap data, which may be used to bypass mitigations when combined with another vulnerability.
What the attacker needed
Victim opens a malicious RLA file
The fix
The vendor released a patch on 2022-11-01.
How it was found
- Craft a malformed RLA file with a scanline offset table pointing to RLE data.
- Set the RLE record length such that the encoded buffer ends exactly when the decoder index reaches the last byte.
- Trigger decoding of the scanline, causing the decoder to read one byte past the buffer.
- The out-of-bounds byte is written into the output image buffer, leaking heap data.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
OpenImageIO is a library that reads many image formats, including the old RLA format. When it decodes compressed image data, a small counting mistake lets it read one byte past the end of a buffer. That extra byte can contain leftover memory data, which might reveal secrets if the attacker can see the output.
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.