Skip to content
Memory corruption Advisory Advanced CVE-2023-43641

GHSL-2023-197: Out-of-bounds array access in libcue- CVE-2023-43641

libcue's track_set_index function fails to check for negative index values, allowing an out-of-bounds array write. An attacker could exploit this by crafting a malicious CUE file with a large index number that overflows to a negative value, potentially leading to code execution.

kevinbackhouse Follow

Originally disclosed on GitHub Security Lab

libcue is a library for parsing CUE sheet files. A malicious file can trigger an out-of-bounds array access in the tracksetindex function.

kevinbackhouse, on GitHub Security Lab

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

Impact

This issue may lead to code execution when libcue is used to parse a malicious file.

What the attacker needed

Victim opens a malicious CUE file; libcue is used to parse the file

How it was found

  1. Create a CUE file with a track number and an INDEX command containing a large decimal number that overflows to a negative value when parsed by atoi.
  2. Open or parse the malicious CUE file with a program that uses libcue.
  3. The negative index causes an out-of-bounds write in track_set_index.

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.

libcue is a library that reads CUE sheet files, which describe how audio tracks are laid out on a CD. The library has a function that stores track index numbers in an array, but it only checks if the number is too large, not if it is negative. By supplying a very large number that wraps around to a negative value, an attacker can make the library write outside the array, which can crash the program or, in some cases, let the 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 kevinbackhouse

View all

47 more disclosed reports, best first.

More from GitHub Security Lab

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.