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

The Biosig Project libbiosig MFER Tag 3 null write stack-based buffer overflow vulnerability

A stack-based buffer overflow exists in libbiosig's MFER parsing when a tag 3 frame has a length greater than 16, causing a null byte to be written past a 17-byte stack buffer. An attacker could supply a malicious MFER file to potentially achieve arbitrary code execution.

Mark Bereza Follow

Originally disclosed on Cisco Talos

High 8.1 View original

A stack-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 code checks the length and prints a warning if it exceeds 16, but still uses the unchecked length as an index to write a null terminator past the end of a 17-byte stack buffer.

Impact

A crafted MFER file could cause a single null byte to be written past a stack buffer at an attacker-controlled offset, potentially leading to arbitrary code execution.

What the attacker needed

Victim opens a crafted MFER file

How it was found

  1. Craft an MFER file with a tag 3 frame whose length is greater than 16.
  2. Feed the file to libbiosig's sopen_extended function.
  3. Observe the warning about incorrect length.
  4. The code reads the data into a 17-byte buffer and then writes a null byte at index len, overflowing the buffer.

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 buffer overflow happens when a program writes more data into a fixed-size memory area than it can hold, spilling into nearby memory. Here, a file format parser reads a length from the file and uses it to place a zero byte just past a small local array, which can corrupt the program's control flow. An attacker who can make the victim open a crafted file might then 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.