Skip to content
Info disclosure Advisory Intermediate CVE-2023-22845

OpenImageIO Project OpenImageIO TGAInput::decode_pixel() out-of-bounds read vulnerability

An out-of-bounds read exists in OpenImageIO's TGA decoder because the cmap_first header field is not validated against the palette buffer size. A crafted TGA file can cause the decoder to read heap memory beyond the allocated palette, leading to information disclosure.

Lilith >_> Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An out-of-bounds read vulnerability exists in the TGAInput::decodepixel() functionality of OpenImageIO Project OpenImageIO v2.4.7.1. A specially crafted targa file can lead to information disclosure.

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

Likely the cmap_first field from the TGA header is used to index into the palette buffer without any bounds check.

Impact

An attacker could cause an out-of-bounds heap read, potentially disclosing sensitive information from memory.

What the attacker needed

Victim opens a crafted TGA file

How it was found

  1. Open a specially crafted TGA file with OpenImageIO.
  2. The TGA header is read, including an unchecked cmap_first value.
  3. The palette buffer is allocated and filled based on cmap_length.
  4. During pixel decoding, cmap_first is added to the pixel index and multiplied by palbytespp.
  5. The resulting offset is used to read from the palette buffer, going out of bounds.

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 file is opened, the program reads a small header that says where the colour palette starts. This program trusts that number without checking it, so a malicious file can make it look far outside the palette data. The program then reads memory it should not, which can leak information.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.