The Biosig Project libbiosig .egi parsing heap-based buffer overflow vulnerability
A heap-based buffer overflow exists in the .egi file parsing of libbiosig. A crafted .egi file can cause out-of-bounds writes, potentially leading to arbitrary code execution.
Originally disclosed on Cisco Talos
A heap-based buffer overflow vulnerability exists in the .egi parsing functionality of The Biosig Project libbiosig 2.5.0 and Master Branch (ab0ee111). A specially crafted .egi 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 code allocates a fixed-size array for event code descriptions but then loops based on an attacker-controlled count (NEC) without checking if it exceeds the array size, causing out-of-bounds writes.
What the attacker needed
Victim opens a malicious .egi file
The fix
The vendor provided a new release that likely fixes the vulnerability.
How it was found
- Craft a file that passes the .egi file type check.
- Set the version field to an odd value to enter the branch that reads NEC from a variable position.
- Set the NEC field to a value greater than 0x101.
- Open the file with libbiosig, triggering the 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 heap buffer overflow happens when a program writes more data into a memory buffer than it can hold, corrupting nearby memory. Here, a malicious .egi file tricks the program into writing past the end of a buffer, which can crash the program or 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.