Skip to content
Memory corruption Advisory Advanced CVE-2025-53511

The Biosig Project libbiosig MFER default NS mismatch heap-based buffer overflow vulnerability

A heap-based buffer overflow exists in libbiosig's MFER file parsing because the channel array is allocated with zero elements while the parser assumes at least one channel. An attacker can supply a crafted MFER file to trigger out-of-bounds writes, potentially leading to arbitrary code execution.

Mark Bereza Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A heap-based buffer overflow vulnerability exists in the MFER parsing functionality of The Biosig Project libbiosig 3.9.0 and Master Branch (35a819fa). A specially crafted MFER file can lead to arbitrary code execution.

Mark Bereza and 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 channel array is allocated with zero elements by constructHDR, but the MFER parser initialises the channel count to one and writes to the first channel entry without resizing the array.

Impact

This flaw can potentially lead to arbitrary code execution, and some writes are at least partially attacker-controlled.

What the attacker needed

Victim opens a crafted MFER file

How it was found

  1. Craft an MFER file that does not include a tag 5 frame, so the channel array is never resized.
  2. Feed the file to libbiosig's sopen_extended function.
  3. The parser initialises hdr->NS to 1 and enters the channel processing loop.
  4. The loop writes to members of the first CHANNEL_TYPE structure, which lies beyond the allocated heap buffer.
  5. AddressSanitizer reports a heap-buffer-overflow on the write to hc->Transducer[0].

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 medical file reader sets aside a tiny amount of memory for channel information but then writes a full channel record into it, spilling past the end. This is like pouring a large drink into a small cup: the extra liquid goes everywhere. An attacker can craft a file that causes this overflow, and in some cases control what data is written, which could let them 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 Mark Bereza

View all

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