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

The Biosig Project libbiosig sopen_FAMOS_read use-after-free vulnerability

A use-after-free vulnerability in libbiosig's sopen_FAMOS_read function occurs when parsing a specially crafted .famos file, because the code does not update local pointers after realloc moves the buffer. An attacker could exploit this to achieve arbitrary code execution.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A use-after-free vulnerability exists in the sopenFAMOSread functionality of The Biosig Project libbiosig 2.5.0 and Master Branch (ab0ee111). A specially crafted .famos file 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 code calls realloc on hdr->AS.Header but fails to update the local pointers t and t2, which then point to freed memory.

Impact

This could lead to arbitrary code execution, as the use-after-free allows reading and writing freed memory.

What the attacker needed

Victim opens a malicious .famos file

The fix

The vendor provided a new release that likely fixes the issue by updating pointers after realloc.

How it was found

  1. Craft a .famos file that starts with the magic bytes '|CF,' to be recognised as FAMOS format.
  2. Include lines with opcodes such as 'CF,2', 'CK,1', and 'NO,1' to drive the parser into the vulnerable branch.
  3. Ensure the file size and content cause the realloc at [9] to move the buffer, leaving t and t2 dangling.
  4. Open the file with libbiosig, triggering the use-after-free when t and t2 are dereferenced.

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 a program reads a file, it stores the data in memory. If it later needs more space, it may move that data to a new location, but if it keeps using the old address, it ends up reading or writing memory that has been freed. This is called a use-after-free, and an attacker can craft a file to control what happens at that old address, potentially running 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.