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

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.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

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.

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

  1. Craft a file that passes the .egi file type check.
  2. Set the version field to an odd value to enter the branch that reads NEC from a variable position.
  3. Set the NEC field to a value greater than 0x101.
  4. 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.

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.