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.
Originally disclosed on Cisco Talos
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.
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
- Create a file starting with the BrainVision marker magic string.
- Include a line starting with '[Marker Infos]' to set the parser state.
- Add a line starting with 'Mk' that contains fewer than five commas and is at the end of the file.
- 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.