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

The Biosig Project libbiosig ABF parsing integer overflow to heap-based buffer overflow vulnerability

An integer overflow in the ABF file parsing of libbiosig allows a crafted file to cause a heap-based buffer overflow, potentially leading to arbitrary code execution.

Mark Bereza Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

An integer overflow vulnerability exists in the ABF parsing functionality of The Biosig Project libbiosig 3.9.0 and Master Branch (35a819fa). A specially crafted ABF 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 sum of two 32-bit fields from the file overflows, causing a smaller allocation than the loop that writes into it.

Impact

A crafted file could lead to arbitrary code execution, though the overflow may be limited by heap layout and the fixed value written to one buffer.

What the attacker needed

Victim opens a malicious ABF file

The fix

The integer overflow should be prevented by validating the sum of the two fields before using it for allocation and loop bounds.

How it was found

  1. Craft an ABF file with a header that passes the ABF magic check.
  2. Set lActualEpisodes and lNumTagEntries to values that cause an integer overflow when summed.
  3. Open the file with libbiosig, which calls sopen_extended and then sopen_abf_read.
  4. The overflowed event count leads to undersized heap buffers for event positions and types.
  5. The loop writing events then writes past the end of those buffers.

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.

When a program reads a file, it often uses numbers from the file to decide how much memory to set aside. If those numbers are very large, adding them together can wrap around to a small number, so the program sets aside too little memory. Then it writes more data than fits, spilling into other memory and possibly letting 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 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.