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

The Biosig Project libbiosig BrainVisionMarker Parsing Out-of-bounds Write vulnerability

An out-of-bounds write vulnerability exists in the BrainVisionMarker parsing of libbiosig, where a crafted .vmrk file can cause heap corruption and potentially lead to arbitrary code execution.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

An out-of-bounds write vulnerability exists in the BrainVisionMarker Parsing functionality of The Biosig Project libbiosig 2.5.0 and Master Branch (ab0ee111). A specially crafted .vmrk 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 parser uses strcspn to find commas in a line, but if the line ends without enough commas, strcspn reads past the end of the string and then writes null bytes at those out-of-bounds positions.

What the attacker needed

Victim opens a malicious .vmrk file

The fix

The vendor released a patched version; users should upgrade to the latest version.

How it was found

  1. Create a file starting with the BrainVision marker magic string.
  2. Include a line starting with '[Marker Infos]' to set the parser state.
  3. Add a line starting with 'Mk' that contains fewer than five commas and is at the end of the file.
  4. Open the file with libbiosig to trigger the out-of-bounds write.

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.

This bug is in a library that reads medical data files. When it parses a marker file, it can write past the end of a memory buffer, corrupting other data. An attacker could use this to run their own code on the victim's computer.

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.