The Biosig Project libbiosig MFER parsing multiple stack-based buffer overflow vulnerabilities
Several stack-based buffer overflows exist in libbiosig's MFER file parsing because length fields from the file are used to read data into fixed-size stack buffers without bounds checks. An attacker could supply a malicious MFER file to cause a crash or potentially execute arbitrary code.
Originally disclosed on Cisco Talos
Several stack-based buffer overflow vulnerabilities exists in the MFER parsing functionality of The Biosig Project libbiosig 3.9.1. A specially crafted MFER file can lead to arbitrary code execution.
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 MFER parser reads a length from the file and passes it to ifread without checking that the destination stack buffer is large enough.
Impact
An attacker could write arbitrary data past the end of a stack buffer, potentially resulting in arbitrary code execution.
What the attacker needed
Victim opens a malicious MFER file
The fix
The vendor released a patch on 2025-12-10, though the text does not describe the fix details.
How it was found
- Craft an MFER file with a tag value of 3 and a length field greater than 16.
- Open the file with libbiosig, which calls sopen_extended and identifies it as MFER.
- The parser reads the length and calls ifread to copy that many bytes into the 17-byte stack buffer v.
- The overflow occurs, as shown by AddressSanitizer reporting a stack-buffer-overflow.
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, the program trusts a length value from the file and copies that many bytes into a small stack buffer, so a crafted file can overwrite other data on the stack. This can crash the program or, in some cases, 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.