Skip to content
Memory corruption Advisory Advanced CVE-2022-38143

OpenImageIO RLE encoded BMP image out-of-bounds write vulnerability

OpenImageIO's RLE BMP decoder fails to validate the y-coordinate when writing decompressed pixels, allowing a crafted BMP file to write out-of-bounds heap memory. An attacker could achieve arbitrary code execution by providing a malicious file.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A heap out-of-bounds write vulnerability exists in the way OpenImageIO v2.3.19.0 processes RLE encoded BMP images. A specially-crafted bmp file can write to arbitrary out of bounds memory, which can lead to arbitrary code execution.

Lilith >_>, on Cisco Talos

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

The RLE decoder checks the x-coordinate against the image width but never checks the y-coordinate against the image height before writing to the buffer.

What the attacker needed

Victim opens a malicious BMP file

How it was found

  1. Craft a BMP file with RLE compression and dimensions that cause the buffer to be small.
  2. Use the delta opcode repeatedly to increment the y-coordinate beyond the image height.
  3. Write pixel data at the out-of-bounds y-coordinate, causing a heap buffer overflow.

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.

When an image is compressed, the program unpacks it into a memory buffer sized to the image dimensions. The code checks the horizontal position but not the vertical position, so a malicious file can move the write position far below the buffer and overwrite other memory. This can crash the program or let an attacker run their own code.

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.

More by Lilith >_>

View all

148 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.