Skip to content
Memory corruption Advisory Advanced CVE-2024-36474

GNOME Project G Structured File Library (libgsf) Compound Document Binary File Directory integer overflow vulnerability

The libgsf compound document parser computes the size of a directory tracking array in 32-bit arithmetic, so a crafted file can make that multiplication wrap and allocate a buffer that is too small. The parser then indexes and writes past the end of that buffer, which the report says can lead to arbitrary code execution.

A member Follow

Originally disclosed on Cisco Talos

High 8.4 View original

An integer overflow vulnerability exists in the Compound Document Binary File format parser of the GNOME Project G Structured File Library (libgsf) version v1.14.52. A specially crafted file can result in an integer overflow when processing the directory from the file that allows for an out-of-bounds index to be used…

a member, 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 directory tracking buffer size is computed as a 32-bit product of sector count, sector size and entry size, which can wrap and yield an undersized allocation that is then indexed by attacker-controlled directory entry numbers.

Impact

The report states this can lead to arbitrary code execution, and notes that the tracker-miners service parses files under the user's home directory without interaction, though the demonstrated result is an out-of-bounds read under AddressSanitizer.

What the attacker needed

Attacker supplies a crafted file; victim or service parses the file

How it was found

  1. Craft a compound document file whose header and directory sector chain cause the directory buffer size calculation to overflow.
  2. Open the crafted file so the library parses it through its normal entry point.
  3. The parser allocates the undersized tracking array and begins reading directory entries.
  4. Directory entry fields drive recursion to entry indices beyond the allocated array, causing out-of-bounds reads and writes.

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.

A compound document file is a container, like a zip, that holds several streams of data plus a directory listing them. The library works out how much memory to reserve for tracking which directory entries it has already visited, but the sum is done in a fixed-width number that can wrap around to a small value. A malicious file makes that happen, so the program later reads and writes past the end of the small buffer, which can crash it 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 A member

View all

110 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.