Open Babel GRO format res uninitialized pointer dereference vulnerability
An uninitialized pointer in Open Babel's GRO format parser can be dereferenced when a crafted file sets the residue ID to zero, leading to a crash and potentially arbitrary code execution.
Originally disclosed on Cisco Talos
A use of uninitialized pointer vulnerability exists in the GRO format res functionality of Open Babel 3.1.1 and master commit 530dbfa3. A specially crafted malformed 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
Likely, the code fails to initialize a residue pointer before it can be used when the residue ID from the file matches the initial value of zero.
Impact
An attacker could potentially execute arbitrary code by providing a malicious file, though the crash shows a read access violation that may be exploitable depending on stack layout.
What the attacker needed
Victim opens a malicious GRO file with Open Babel
How it was found
- Create a GRO file with a title line, a second line containing a positive integer for the number of atoms, and at least one atom line where the residue ID field (first 5 characters) is set to 0.
- Run the obabel converter with the GRO file as input and any output format, e.g., obabel -i gro malicious.gro -o sdf.
- The program will attempt to add an atom to an uninitialized residue pointer, causing a crash.
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.
Open Babel is a tool that converts chemical file formats. A bug in how it reads a particular format (GRO) means that a specially crafted file can cause the program to use a pointer (a memory address) that hasn't been set to a valid value. This can crash the program and, in some cases, allow an attacker to 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.