The Biosig Project libbiosig BrainVision ASCII Header Parsing double-free vulnerability
A double-free vulnerability exists in the BrainVision ASCII header parsing of libbiosig, where a crafted .vhdr file can cause the same file stream to be freed twice. An attacker could exploit this to achieve arbitrary code execution.
Originally disclosed on Cisco Talos
A double-free vulnerability exists in the BrainVision ASCII Header Parsing functionality of The Biosig Project libbiosig 2.5.0 and Master Branch (ab0ee111). A specially crafted .vdhr 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 file stream is closed and freed early in parsing, then closed again later if the file lacks a [Channel Infos] section and has ASCII flag set, causing a double-free.
Impact
A remote attacker could potentially execute arbitrary code by providing a malicious file, as the double-free may lead to code execution.
What the attacker needed
Victim opens a malicious .vhdr file
The fix
The vendor released a patched version.
How it was found
- Craft a BrainVision .vhdr file that does not contain a [Channel Infos] section.
- Set the FLAG_ASCII option in the file.
- Open the file with libbiosig, which triggers the double-free.
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 report describes a bug in a library that reads medical signal files. When a specially crafted file is opened, the program frees the same memory twice, which can crash it 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.